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 - Newbie, need help with PHP
  FAQ FAQ  Forum Search   Register Register  Login Login

Newbie, need help with PHP

 Post Reply Post Reply
Author
Message
hawkmaster View Drop Down
Beginner
Beginner


Joined: 01 Apr 12
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote hawkmaster Quote  Post ReplyReply Direct Link To This Post Topic: Newbie, need help with PHP
    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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 02 Apr 12 at 1:40PM
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

Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 04 Apr 12 at 4:13AM

You need to check the return value from LoadFromFile - if it returns 0 then it will point to a different problem.

Andrew.
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