Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
[SOLVED] ExtractFilePages |
Post Reply |
Author | |
PolderBoy
Beginner Joined: 13 Oct 10 Status: Offline Points: 13 |
Post Options
Thanks(0)
Posted: 30 Nov 10 at 12:10PM |
Hello All,
Question: I would like to use in VB6 the function: ExtractFilePages( InputFileName As String, OutputFileName As String, RangeList As String) As Long But I keep getting the 412 error which means 'Invalid page range list' strRangeList = "1" strRangeList = "1-2" strRangeList = "1,2" lngResult = ExtractFilePages(strInputFileName, strOutputFileName, strRangeList) I have tried to put it directly into the function call: lngResult = ExtractFilePages(strInputFileName, strOutputFileName, "1") But in all casses we are getting a result of 412. Could it be that we are using the demo version? Thanks in advance. PolderBoy Edited by PolderBoy - 07 Dec 10 at 8:11PM |
|
PolderBoy
Beginner Joined: 13 Oct 10 Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Dear All,
I have tried the function in the 'Quick PDF Library Console' and it doesn't work there either. PolderBoy |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
This could be ... use the testregkey to unlock the library ... and then ExtractFilePages. If this won't work you should post all relevant code from create ... load ... extractfilepages ... free Cheers, Ingo |
|
PolderBoy
Beginner Joined: 13 Oct 10 Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Dear All,
Thank you for the reply. But we are using the testkey, that is something we need to supply otherwise it won't work at all. Here is our code: Private Function PDFPaginaSamenvoegen(InputFileName As String, OutputFileName, RangeList) As Integer Dim ClassName As String Dim intResultaat As Integer ClassName = "QuickPDFAX0721.PDFLibrary" Dim QP Dim Result Set QP = CreateObject(ClassName) Result = QP.UnlockKey(LicenseKey) If Result = 1 Then intResultaat = QP.ExtractFilePages(InputFileName, OutputFileName, RangeList) If intResultaat = 1 Then PDFPaginaSamenvoegen = 1 Else PDFPaginaSamenvoegen = 0 Call MsgBox("De fout code is: " & QP.LastErrorCode, vbOKOnly) End If Else MsgBox "Invalid license key. Please set your license key by editing this file." PDFPaginaSamenvoegen = "ERROR" End If Set QP = Nothing End Function The variable LicenseKey is filled when the program is loaded. The variable InputFileName is filled correct, the file exist, and has 32 pages (QP.pagecount). The variable OutputFileName is a correct adres and file name, doesn't exist. Tried it with an existing file. Same error number (412) RangeList has been tested with all sort of possibilitys. As mentioned in other post. We also use part of the code(the setting of QP) for QP.pagecount So we are sure that some functions work, and part of our code is correct. You said that we should give all the code but this is all the code. Do we need to create the pdf first? Do we need ro load the pdf first? We (I) couldn't find any clear answer to that. I just downloaded the VB6 example and worked from there. Thanks in advance. PolderBoy Edited by PolderBoy - 30 Nov 10 at 5:00PM |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi!
ExtractFilePages works on PDF-documents whithout loading ... Good for the memory-usage ;-) This function is already a very old one - so it should be work stable... If you get always an error the questions could be: With each file or only few? Are the files write protected? EBook-files or something like that? Is there a user password on the file? Where are the files... which path... what about the security settings for this path? Cheers, Ingo |
|
PolderBoy
Beginner Joined: 13 Oct 10 Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Hello,
Thanks for the reply. Good question: As I have only one file tested (for opening) that could be the case. But Adobe Acrobat reader can open the file, no password, the file is on the same harddisk as the VB6 program. Folderpath is correct. The pdf are scans made by a canon scanner of about 32 pages. They are placed, by the canon machine, in the folder. I have moved the files to another folder. No luck. When I make a error bij changing the path to a non existing pdf file we get another error: "Can't find file". That makes me believe that it hasn't anything to do with the files or folders. Could I sent you the pdf file? And could you test it there with you? And, most important, would you? PolderBoy |
|
PolderBoy
Beginner Joined: 13 Oct 10 Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Dear All,
I have been testing the VB6 code and found out the fact that I can only use the function if page 1 is included: These are the strings that I 'give' into the function: (Private Function PDFPaginaSamenvoegen(InputFileName As String, OutputFileName as String, RangeList as String) As Integer) 1,2,3,4 -->works 5,7,9 --> gives error 412 5 --> gives error 412 1 -->works 1,2,3 -->works 2,3,4,5 --> gives error 412 I don't always want to include the first page. I could and after succesful making the file, remove the first page if needed. But that is not the way I would like to make the program. I hope somebody can help me further. PolderBoy |
|
PolderBoy
Beginner Joined: 13 Oct 10 Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Hello All,
Just to let you all know we/I have solved it. Well not really we just tried something else: ExtractPageRangesFirst load the file then extractpageranges and put the in another pdf file. Thanks for all the help. POlderBoy |
|
markc
Beginner Joined: 10 Jan 11 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
We had identical problem with DELPHI
I will try using the PageRange function.
But still the function EXTRACTFILEPAGES needs to be fixed.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store