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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - [SOLVED] ExtractFilePages
  FAQ FAQ  Forum Search   Register Register  Login Login

[SOLVED] ExtractFilePages

 Post Reply Post Reply
Author
Message
PolderBoy View Drop Down
Beginner
Beginner


Joined: 13 Oct 10
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote PolderBoy Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] ExtractFilePages
    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
Back to Top
PolderBoy View Drop Down
Beginner
Beginner


Joined: 13 Oct 10
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote PolderBoy Quote  Post ReplyReply Direct Link To This Post Posted: 30 Nov 10 at 1:18PM
Dear All,

I have tried the function in the 'Quick PDF Library Console' and it doesn't work there either.

PolderBoy
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 30 Nov 10 at 2:43PM
Originally posted by PolderBoy PolderBoy wrote:


Could it be that we are using the demo version?


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

Back to Top
PolderBoy View Drop Down
Beginner
Beginner


Joined: 13 Oct 10
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote PolderBoy Quote  Post ReplyReply Direct Link To This Post Posted: 30 Nov 10 at 4:48PM
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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 30 Nov 10 at 6:05PM
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
 
Back to Top
PolderBoy View Drop Down
Beginner
Beginner


Joined: 13 Oct 10
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote PolderBoy Quote  Post ReplyReply Direct Link To This Post Posted: 30 Nov 10 at 6:19PM
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

Back to Top
PolderBoy View Drop Down
Beginner
Beginner


Joined: 13 Oct 10
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote PolderBoy Quote  Post ReplyReply Direct Link To This Post Posted: 05 Dec 10 at 11:48AM
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

Back to Top
PolderBoy View Drop Down
Beginner
Beginner


Joined: 13 Oct 10
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote PolderBoy Quote  Post ReplyReply Direct Link To This Post Posted: 07 Dec 10 at 8:10PM
Hello All,

Just to let you all know we/I have solved it.
Well not really we just tried something else:

ExtractPageRanges


First load the file then extractpageranges and put the in another pdf file.

Thanks for all the help.

POlderBoy
Back to Top
markc View Drop Down
Beginner
Beginner


Joined: 10 Jan 11
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote markc Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jan 11 at 4:47PM
We had identical problem with DELPHI
I will try using the PageRange function.
 
But still the function EXTRACTFILEPAGES needs to be fixed.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store