Zend Framework

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

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.2
  • Fix Version/s: 1.7.1
  • Component/s: Zend_Pdf
  • Labels:
    None
  • Fix Version Priority:
    Should Have

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

Issue Links

Activity

Hide
Alexander Veremyev added a comment -

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

Show
Alexander Veremyev added a comment - Could you also attach a script you are using to update PDF document?
Hide
Logan Buesching added a comment -

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";

?>

Show
Logan Buesching added a comment - 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"; ?>
Hide
Wil Sinclair added a comment -

Please evaluate and categorize as necessary.

Show
Wil Sinclair added a comment - Please evaluate and categorize as necessary.
Hide
Alexander Veremyev added a comment -

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.

Show
Alexander Veremyev added a comment - 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.
Hide
Alexander Veremyev added a comment -

Fixed (correct error message is provided).

Show
Alexander Veremyev added a comment - Fixed (correct error message is provided).

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: