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!
![]() |
Newbie, need help with PHP |
Post Reply ![]() |
Author | |
hawkmaster ![]() Beginner ![]() Joined: 01 Apr 12 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() Posted: 01 Apr 12 at 6:55PM |
Hello,
I have downloaded QuickPDFLibrary QuickPDFAX0814 and tried to split a pdf like in the Developers guide. Problem is. Total Pages shows only 1 instead of 31 pages of the PDF file. Next is a crash with DocumentRemove: com->RemoveDocument(1476395008) Description:</b> List index out of bounds (1)' $qp1 = new COM("QuickPDFAX0814.PDFLibrary"); $pdfsource = $file_name; $qp1->LoadFromFile($pdfsource,""); // Use the SelectedDocument function to get the // document ID of the file that we just loaded. $DocID = $qp1->SelectedDocument(); // Count the total number of pages in the // selected document. We need the total // number of pages before we can use the // ExtractFilePages function. $TotalPages = $qp1->PageCount(); echo "total pages ist $TotalPages <br>"; // Remove the selected document from memory. $qp1->RemoveDocument($DocID); //QP.RemoveDocument(DocID); // Loop through each page in the document // and use the ExtractFilePages function // to copy and save each page in the // document to a new document. for ( $n = 1; $n < $TotalPages; $n++) { echo "schleife $n <br>"; $qp1->ExtractFilePages($pdfsource, "sample_split_" + Convert.ToString(n) + ".pdf", Convert.ToString(n)); } Can anybody helpme or give me some exampes? kind regards Hans |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Hans!
This (in Delphi) should be enough to get the pagecount: try QP := TQuickPDF0814.Create; try Result1 := QP.UnlockKey(LicenseKey); Result2 := QP.LoadFromFile(FileName); paco := QP.PageCount; // . . . finally QP.Free; end; I think that it's senseless to remove a document if there's only one (mostly that's it) document inside a pdf. The other thing: The function calls "SelectDocument" ;-) You should have a look inside the online tutorials on the official supportpages starting at www.QuickPDF.org... Cheers and welcome here, Ingo |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
You need to check the return value from LoadFromFile - if it returns 0 then it will point to a different problem. Andrew.
|
|
![]() |
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