Showing posts with label pdf. Show all posts
Showing posts with label pdf. Show all posts

Wednesday, February 20, 2013

Convert PS to PDF, A4 vs Letter

In the US here we use some paper size called "letter" and apparently elsewhere they use A4, and for some reason is very close, but not quite the same. Probably some sort of metric thing. Anyway, I got a PostScript file that was created for A4 size output and wanted to convert it to a PDF. Regular ol' ps2pdf would truncate parts of the border, same with printing to a pdf. So, even though its not in "my" man page for ps2pdf, there is an option for telling ps2pdf the type of paper to expect.
$ ps2pdf -sPAPERSIZE=a4 toconvert.ps converted.pdf
Edit:
I did a bit more messing around: this page at linuxjournal.com has a lot of additional information on these types of conversions. In Arch, the package you need to get psselect is "psutils". I ended up having to experiment a bit to get what I needed. I wanted to remove the first 3 pages which were cover pages.

The command below did what I needed, order of arguments is important.
$ psselect -p3-25 toconvert.ps | ps2pdf -sPAPERSIZE=a4 - converted.pdf
The first command select pages 3-25 of the input PS file, pipes that to ps2pdf which then uses a dash "-" in place of the input file name.

Thursday, January 10, 2013

Fix PDF showing inifinity instead of bullets

I've had this problem for a long time, sometimes a PDF was created with a font that doesn't get mapped properly and the bullet points show up as inifinity symbols.

I found this post for Ubuntu: https://bugs.launchpad.net/ubuntu/+source/fontconfig/+bug/551977

$ fc-match Symbol symbol.ttf: "Symbol" "Regular"
A workaround is adding this code to /etc/fonts/local.conf and the bullets would appear:
<match target="pattern">  <test name="family">   <string>Symbol</string>  </test>  <edit name="family" mode="prepend" binding="same">   <string>Standard Symbols L</string>  </edit> </match>
$ fc-match Symbol s050000l.pfb: "Standard Symbols L" "Regular"
This worked perfectly in Arch for me.