pdf to raster

sometimes it is required to extract only one page from pdf document

gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dFirstPage=3 -dLastPage=3 -sOutputFile=3rdpageonly.pdf full-document.pdf

sometimes it is required to fool stupid pdf readers and convert pdf to raster, it is simple, and requires free imagemagick and ghostscript packages

$ gs -q -sDEVICE=png16m -r288 -dBATCH -dNOPAUSE -dFirstPage=1 -dLastPage=1 -sOutputFile=INVOICE.png INVOICE.pdf
$ convert INVOICE.png -units PixelsPerInch -density 288 -resize "2448x3168" INVOICE.pdf

sometimes you want to combine few pdf documents into one:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combinedpdf.pdf -dBATCH INVOICE1.pdf INVOICE2.pdf


# apt-get install pdftk
$ pdftk sourcefile.pdf cat 130-140 output test.pdf 

later you can send your mail, using e.g.

* https://www.cfhdocmail.com/live/createmailing.aspx

  • faq/pdf.txt
  • Last modified: 19 months ago
  • by Dr Serge Victor