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 > General Discussion
  New Posts New Posts RSS Feed - Page extraction problem
  FAQ FAQ  Forum Search   Register Register  Login Login

Page extraction problem

 Post Reply Post Reply
Author
Message
SlyJay View Drop Down
Beginner
Beginner
Avatar

Joined: 20 Mar 10
Location: Italy
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote SlyJay Quote  Post ReplyReply Direct Link To This Post Topic: Page extraction problem
    Posted: 22 Mar 10 at 9:19AM
Hi everybody,
I have a problem during extraction process.
 
Given a source pdf file "source.pdf" if I call "QP.ExtractFilePages" for a certain range let's say 1-2 it crates a file with the 2 pages correctly, but if a call it a second time lats say with a range like 1-3 it generates a file with page 1,2,1 instead of 1,2,3. It copies allways the first page at the end after calling it a second time.
 
To clarify better, the forst time works correctly extracting the right pages but the second time it seems to append allways the fisrt page to the previous extracted range as many times as the current range exeeds the first range (1,2,1,1,1.......).
 
I've also tried to create a new istance of quickPdf for each extraction process but the behaviour is the same.
 
Any clue???
 
If you need more information just ask, I didn't post the code since we all use different languages but my code is in VB.net.
 
Thanks in advance
 
Sly 
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 22 Mar 10 at 9:54AM
Hi Sly, it would be helpful if you posted your code. It doesn't really mater what language it's in, the important thing is that everyone gets to see the functions that you have used and the sequence in which they were called... 
Back to Top
SlyJay View Drop Down
Beginner
Beginner
Avatar

Joined: 20 Mar 10
Location: Italy
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote SlyJay Quote  Post ReplyReply Direct Link To This Post Posted: 22 Mar 10 at 10:25AM
Here is my code:
    Private Sub PDFInsertPagesFromFile(ByVal destFile As String, ByVal insertFile As String, ByVal position As Integer)

 

        Dim tmpQP As New QuickPDFAX0718.PDFLibrary

        tmpQP.UnlockKey("my_code")

 

        tmpQP.LoadFromFile(destFile)

        Dim mainDoc As Integer = tmpQP.SelectedDocument

        Dim LastPart As Integer = 0

        Dim FirstPart As Integer = 0

 

        FirstPart = tmpQP.ExtractFilePages(destFile, My.Application.Info.DirectoryPath & "\1.pdf", "1-" & position)

        If FirstPart = 0 Then

            Exit Sub

        End If

 

        If tmpQP.PageCount > position Then

            tmpQP.DeletePages(1, position)

            tmpQP.SaveToFile(My.Application.Info.DirectoryPath & "\3.pdf")

            LastPart = 1

        End If

 

        tmpQP.MergeFiles(My.Application.Info.DirectoryPath & "\1.pdf", insertFile, My.Application.Info.DirectoryPath & "\2.pdf")

        IO.File.Delete(destFile)

        If LastPart > 0 Then

            tmpQP.MergeFiles(My.Application.Info.DirectoryPath & "\2.pdf", My.Application.Info.DirectoryPath & "\3.pdf", destFile)

            IO.File.Delete(My.Application.Info.DirectoryPath & "\3.pdf")

        Else

            IO.File.Move(My.Application.Info.DirectoryPath & "\2.pdf", destFile)

        End If

 

        IO.File.Delete(My.Application.Info.DirectoryPath & "\1.pdf")

        IO.File.Delete(My.Application.Info.DirectoryPath & "\2.pdf")

 

    End Sub

 
Consider that exept from the rest of the code witch is not the best due to multiple tries the problems resides in this line:
 
FirstPart = tmpQP.ExtractFilePages(destFile, My.Application.Info.DirectoryPath & "\1.pdf", "1-" & position)
 
when you call the SUB the secondtime the extraction process  fails doing the problem 1,2,1,1,1....
 
Hope this helps.
 
Thanks
 
Sly
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