PDF

The Portable Document Format developed by Adobe - essentially Encapsulated PostScript with a few indexing,crypto and security features thrown in.

Resources

Date Link Notes
2006-07-09 epub2pdf A tool to output EPUB files to PDF.
2006-05-02 Tabbloid An interesting service that takes RSS feeds and e-mails you a PDF magazine.
2005 PDFTools for , allows for combining and manipulating multiple files.
2005 CutePDF works properly under Terminal Services, , etc. (my current choice)
2005 Primo PDF doesn’t work properly under Terminal Services for some reason
2005 PDF Creator
2005 Ghostscript The one that started it all
2005 RedMon The ancient print redirector
2005 PrinceXML converts XHTML into hyperlinked PDF documents
2005 Foxit PDF Viewer very fast, very small, somewhat buggy image display and font rendering. Lets you remove all toolbars, advertising, etc.
2005 Multivalent PDF Tools written in
2005 FPDF a class to generate PDFs (Ruby port)

uses Display PostScript (part of its heritage), so you don’t need anything to view or create PDFs in it (just save the Print Preview results to a file).

Samba Printer

[smbpdf]
  comment = PDF Generator
  path = /var/spool/samba
  printable = Yes
  print command = gs -dNOPAUSE -dBATCH -q - \
  sDEVICE=pdfwrite -sOutputFile=%H/%s.pdf; rm %s

Compression

Here’s a plugin for PDF compression that I used under , but you can just do:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH --sOutputFile=file-out.pdf file-in.pdf

#...or:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dColorConversionStrategy=/Gray -dProcessColorModel=/DeviceGray -dNOPAUSE -dQUIET -dBATCH -sOutputFile=file-out.pdf file-in.pdf

Simulating a Scanned Image

#!/bin/sh
ROTATION=$(shuf -n 1 -e ‘-‘ ‘’)$(shuf -n 1 -e $(seq 0.05 .5))

convert -density 150 $1 \
  -linear-stretch ‘1.5%x2%’ \
  -rotate ${ROTATION} \
  -attenuate ‘0.01’ \
  +noise  Multiplicative \
  -colorspace ‘gray’ $2

Editing PDFs

I’ve found that LibreOffice Writer has the ability to edit PDFs in-line to some degree (thanks to its integration with Draw). It will not preserve font names or styles, though.

Affinitiy Designer, however, can do so much better (although it will not deal with embedded fonts)

Removing Metadata

You can tweak or remove document metadata by using a pdfmarks file with Ghostscript:

[ /Title (Document title)
  /Author (Author name)
  /Subject (Subject description)
  /Keywords (comma, separated, keywords)
  /ModDate (D:20061204092842)
  /CreationDate (D:20061204092842)
  /Creator (application name or creator note)
  /Producer (PDF producer name or note)
  /DOCINFO pdfmark

…and combining it like this:

gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf original.pdf pdfmarks

Removing Passwords

The qpdf utility (some assembly required) can do it cleanly like so:

qpdf —password=foobar —decrypt orig.pdf new.pdf

This page is referenced in: