Question

is there any possibility to resize an Zend_Pdf_Page Object from (e.g.) DIN-A4 to DIN-A6 (or any other size)?

i would like to merge 4 PDF (1 page) files to 1 pdf file (1 page). in each edge should be one of the 4 pdf files.

positioning, grid, e.g. is no problem... but how can i change the document size (of an existing pdf file) and how can i rotate the whole document?

i work with ZF1, but if the only way to fix this problem is to use an external library - no problem.

PS: sorry for my bad english (hope it is enough to understand my problem)


edit : 14:49 05/12/2014

also tried with imagick to convert pdf to image, but quality is too bad for printing as those small thumbs... :-(

Était-ce utile?

La solution

Technically your requirements could be done by transforming the page into a so called form XObject which can be place on a new created page. That's how FPDI works: http://www.setasign.com/products/fpdi/demos/thumbnails/ (maybee an alternative for you).

I just checked the code of ZendPdf but I cannot find any method that may allow this.

Rotation can be done with FPDF/FPDI too: http://fpdf.org/en/script/script2.php

Autres conseils

In your code, if you have something like $page = new Zend_Pdf_Page(); you can set here the desired dimensions.

For example, you can write $page = new Zend_Pdf_Page('297:420'); for A6 format (if I'm not mistaken).

To represent an A4 page in landscape (wide) orientation, you can write
$page = new Zend_Pdf_Page('a4-landscape');
or
$page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4_LANDSCAPE);

You can look at the documentation or the source code of the constructor of the Zend_Pdf_Page class for more information.

I hope it will help you. :)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top