Friday, December 8, 2017

zoom pdf for printing

This may help to install pdfedit on Ubuntu 14.04 Trusty https://askubuntu.com/questions/538966/how-can-i-install-pdfedit-on-ubuntu-14-04 and this on Ubuntu 16.04 Xenial https://gist.github.com/bmaupin/a23161b50f27179e6e5b064d6066b034.

Start pdfedit.

If the pdf file is uneditable then Tools > Delinearize it.

Use Page > Set page transformation matrix to find the transformation you want. You need to check Page transformation matrix description > Select which transformations to use. This only changes one page.

The programming language used is the qt script language, ECMAScript, almost identical to JavaScript. The API functions are listed in Help > Help.

Save this https://sourceforge.net/p/pdfedit/mailman/pdfedit-support/thread/20080707173451.GG4157%40dhcp35.suse.cz/ inspired script in ./zoom.qs:
f = loadPdf("myfile.pdf");
pg = f.getFirstPage();
pg.setTransformMatrix([1.4,0,0,1.4,-130,-180]);
while (f.hasNextPage(pg)) {
pg = f.getNextPage(pg);
pg.setTransformMatrix([1.4,0,0,1.4,-130,-180]); }
f.save();
f.unloadPdf();


Modify the arguments of setTransformMatrix into your desired ones found using Page > Set page transformation matrix. Parameters 1 and 4 should not be 0, that would make the text invisible.

Copy your pdf file to be processed in ./myfile.pdf.

Issue:
$ pdfedit -s zoom.qs

You can print with:
$ lp -o media-size=a4,fit-to-page -P 1 myfile.pdf

It would be nice to calculate the transformation matrix using the printer acceptable minimal margins, but I don't know how to get the current margins of the document.