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!
Page extraction problem |
Post Reply |
Author | |
SlyJay
Beginner Joined: 20 Mar 10 Location: Italy Status: Offline Points: 6 |
Post Options
Thanks(0)
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
|
|
Rowan
Moderator Group Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
|
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...
|
|
SlyJay
Beginner Joined: 20 Mar 10 Location: Italy Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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
|
|
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