ZF-2664: Nothing shows when adding a page to a PDF with non-zero start number


When I create a page in a PDF document that has a non-zero start number, it shows nothing on the page. I used the exact same code with a PDF document that has a zero start number and it added the text just fine.

Original PDF w/o modifications: http://loganbuesching.com/original.pdf

PDF w/modifications http://loganbuesching.com/modified.pdf

Please let me know if there is anything I can help with.

Thanks, Logan


Could you also attach a script you are using to update PDF document?

Here is some sample code that will do it: <?php require 'Zend/Loader.php'; function __autoload($class) { Zend_Loader::loadClass($class); } $pdf=Zend_Pdf::load('original.pdf'); $cover= new Zend_Pdf_Page('A4'); $font=Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES_BOLD); $cover->setFont($font,12); $cover->drawText("HELLO WORLD",100,100); array_unshift($pdf->pages,$cover); $pdf->save('modified.pdf'); echo "done"; ?>

Please evaluate and categorize as necessary.

The problem is that you tried to modify encripted document.

Moreover it has the following encryption options: |Security Method:|Password Security| |Document Open Password:|No| |Permissions Password:|Yes| |Printing:|High Resolution| |Changing the Document:|Not Allowed| |Commenting:|Not Allowed| |Form Field Fill-in or Signing:|Not Allowed| |Document Assembly:|Not Allowed| |Content Copying:|Not Allowed| |Content Accessibility Enabled:|Not Allowed| |Page Extraction:|Not Allowed| |Encryption Level:|-10-bit RC4|

So a document changing is not allowed.

Fixed (correct error message is provided).