Sometimes, I receive digital invoices in PDF format with a password. That way I shouldn't be able to modify them and commit fraud. Unfortunately, this also makes it impossible to perform normal operations on them, such as removing unneeded specifications or merging all invoices into one single file.
Luckily, most Linux distributions come with a tool that can be used to remove these passwords: ghostscript.
In order to remove the password, simply run:
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=unencrypted.pdf -c .setpdfwrite -f encrypted.pdf
While this does remove the password, I'm not sure if it does not degrade the quality of the file a little (I don't notice any quality difference, but if you use highres files, you may lose quality).
How to decrypt a PDF file on Linux is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info
To open EPS files on GIMP for Windows, you'll need to install GhostScript. You can download GhostScript here. After installing, you'll also need to configure a system environment variable: GS_PROG. This variable must point to the executable, in my case C:\Program Files\gs\gs9.05\bin\gswin32.exe.
Setting the environment variable is done in the advanced settings of "my computer".
Open EPS files with GIMP for Windows is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info
yum -y install libXt-devel libXext libXext-devel gcc
wget http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/ghostpdl/ghostpdl-8.71.tar.bz2 http://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/GhostPCL/urwfonts-8.71.tar.bz2
for i in ghostpdl* urwfonts* ; do otar jxvf $i;done
mkdir -p /usr/share/ghostpdl/fonts
mv urwfonts-8.7.1/*.ttf /usr/share/ghostpdl/fonts
sed -i "s|/windows/fonts/;/win95/fonts/;/winnt/fonts/|/usr/share/ghostpdl/fonts|g" pl/pjparse.c
It's all pretty much the default stuff, except for the required libs and the fonts. If you don't have the -devel packages, you get weird errors while compiling that don't show exactly what is missing.
To generate A4 output, add @PJL SET PAPER=A4 to the pcl input file.
PCL to PDF conversion on CentOS 5.5 is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info