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 - Extract only the first page instead off all pages
  FAQ FAQ  Forum Search   Register Register  Login Login

Extract only the first page instead off all pages

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

Joined: 10 May 16
Location: France
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mimouni Quote  Post ReplyReply Direct Link To This Post Topic: Extract only the first page instead off all pages
    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++;
}
Back to Top
Mimouni View Drop Down
Beginner
Beginner
Avatar

Joined: 10 May 16
Location: France
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mimouni Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 16 at 3:32PM
we will purchase the last version of QuickPdf(v12) and we hope that will be fine
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 16 at 5:02PM
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?
Back to Top
Mimouni View Drop Down
Beginner
Beginner
Avatar

Joined: 10 May 16
Location: France
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mimouni Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 16 at 5:18PM
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

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: 10 May 16 at 5:40PM
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

Back to Top
Mimouni View Drop Down
Beginner
Beginner
Avatar

Joined: 10 May 16
Location: France
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mimouni Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 16 at 8:59PM
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?
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: 10 May 16 at 9:25PM
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

Back to Top
Mimouni View Drop Down
Beginner
Beginner
Avatar

Joined: 10 May 16
Location: France
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mimouni Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 16 at 7:57AM
@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
Back to Top
Mimouni View Drop Down
Beginner
Beginner
Avatar

Joined: 10 May 16
Location: France
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mimouni Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 16 at 8:30AM
the fact of re-selecting the document inside the loop, resolve the problem but remains to be seen the memory consumption
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