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!
Extract only the first page instead off all pages |
Post Reply |
Author | |
Mimouni
Beginner Joined: 10 May 16 Location: France Status: Offline Points: 9 |
Post Options
Thanks(0)
Posted: 10 May 16 at 2:06PM |
Hi,
I have a strange behavior with QuickPDFNet0916x64 In a snippet code i loop through pdf pages and i try to extract them, but instead of having expected pages i have x times the first one. for( int n = 1; n < TotalPages; n++ ) { int extractPageSuccess = QP.ExtractPages( n, 1 ); if( extractPageSuccess == 0 ) { log.ErrorFormat( "Unable to extract the page number {0}/{1} from the publication", n, TotalPages ); } else { string pdfPageFullPath = Path.Combine( PdfLocalDirectory.FullName, index.ToString().PadLeft( 3, '0' ) + ".pdf" ); QP.SaveToFile( pdfPageFullPath ); log.InfoFormat( "extract the page number {0}/{1} from the publication", n, TotalPages ); splittedPages.Add( new FileInfo( pdfPageFullPath ) ); } index++; } |
|
Mimouni
Beginner Joined: 10 May 16 Location: France Status: Offline Points: 9 |
Post Options
Thanks(0)
|
we will purchase the last version of QuickPdf(v12) and we hope that will be fine
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
I think you have missed this sentence in the manual for ExtractPages: "If successful, the new document will be selected and the original document will be removed from memory".
So after your first extraction, does not the 'current document' become the single-page extract?
|
|
Mimouni
Beginner Joined: 10 May 16 Location: France Status: Offline Points: 9 |
Post Options
Thanks(0)
|
Hi tfrost,
I'm using the documentation of QuickPdf and I don't find this sentence. The problem is that the same snippet of code worked for older version of QuickPdf and now we have trouble with him |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Mimouni,
please read here: http://www.debenu.com/docs/pdf_library_reference/ExtractPages.php ...and here (tfrost is right): http://www.quickpdf.org/forum/please-help-how-to-extract-pages-from-file_topic2466.html Cheers and welcome here, Ingo |
|
Cheers,
Ingo |
|
Mimouni
Beginner Joined: 10 May 16 Location: France Status: Offline Points: 9 |
Post Options
Thanks(0)
|
Thank you Ingo,
If i understood the concept, i should re-select in momory the original pdf document
so, i must add a call of selectDocument function in the beginin of each loop? |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi,
why not use the much easier ExtractFilePages: http://www.debenu.com/docs/pdf_library_reference/ExtractFilePages.php ...or ExtractFilePageEx? Here you'll find alternatives easier to use: http://www.debenu.com/docs/pdf_library_reference/PageManipulation.php |
|
Cheers,
Ingo |
|
Mimouni
Beginner Joined: 10 May 16 Location: France Status: Offline Points: 9 |
Post Options
Thanks(0)
|
@Ingo: i don't use ExtractFilePages or ExtractFilePageEx because i each iteration i must extract one page and not a range of pages
Anyway, i have used ExtractFilePages method and i've had the some bihavior
|
|
Mimouni
Beginner Joined: 10 May 16 Location: France Status: Offline Points: 9 |
Post Options
Thanks(0)
|
the fact of re-selecting the document inside the loop, resolve the problem but remains to be seen the memory consumption
|
|
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