ZF-2664: Nothing shows when adding a page to a PDF with non-zero start number
Description
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
Comments
Posted by Alexander Veremyev (alexander) on 2008-02-15T14:58:03.000+0000
Could you also attach a script you are using to update PDF document?
Posted by Logan Buesching (ljbuesch) on 2008-02-29T13:48:22.000+0000
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"; ?>
Posted by Wil Sinclair (wil) on 2008-03-31T16:12:00.000+0000
Please evaluate and categorize as necessary.
Posted by Alexander Veremyev (alexander) on 2008-11-21T07:26:36.000+0000
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.
Posted by Alexander Veremyev (alexander) on 2008-11-21T07:36:41.000+0000
Fixed (correct error message is provided).