Friday, December 8, 2017

zoom pdf for printing

This may help to install pdfedit on Ubuntu 14.04 Trusty and this on Ubuntu 16.04 Xenial

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 inspired script in ./zoom.qs:
f = loadPdf("myfile.pdf");
pg = f.getFirstPage();
while (f.hasNextPage(pg)) {
pg = f.getNextPage(pg);
pg.setTransformMatrix([1.4,0,0,1.4,-130,-180]); };

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.

$ 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.

Tuesday, October 20, 2015

archlinux pacman - an introduction

Packages in arch repositories are constantly upgraded. When a package is upgraded, its old version is removed from the repository. There are no major arch releases. Each package is upgraded as new versions become available from upstream sources. The repository is always coherent. (The packages in the repository always have compatible versions.) This type of repository is called a rolling repository. Before packages are upgraded in the core, extra and community repositories, they are tested in the testing repository, to ensure that the distribution is stable.

pacman saves to disk a list of packages available in the repository. This list is not automatically updated (refreshed). (The list is a.k.a. repository databases and the update of the list is a.k.a. synchronizing those databases.) The list can be refreshed using pacman -Sy. pacman -Syy refreshes the list even if it appears to be up to date. I don't know the effect of pacman -Syy when the pacman list is newer than that of the mirror, for example as a result of falling back to a different not yet updated mirror.

When the list is outdated it is possible that packages to be installed with pacman -S package are not available.

When pacman installs one package with pacman -S package it takes care that all its correct version dependencies are installed but it does not verify that dependencies of other packages are not broken by such updates. If the list has been updated but packages not, then this command could make the system unusable. That is why the list should only be updated together with all packages in the system with pacman -Syu and you should never run pacman -Sy or pacman -Sy package.