I have a PDF with embedded fonts that I can't seem to work with. Right now, I'm using GhostScript and trying to do 2 things:
Minimize filesize of PDF:
gswin32c -dSAFER -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOutputFile=output.pdf input.pdf
Convert PDF to PNG (super sample, to be used for creating other thumbnails):
gswin32c -dSAFER -dBATCH -dNOPAUSE -dQUIET -dFirstPage=1 -dLastPage=1 -r288 -sDEVICE=png16m -sOutputFile=output.pdf input.pdf
The above works well when working on scanned documents. But when I run them against PDFs with embedded fonts (the PDF is generated on the fly by an application), it fails. Here's the error I get:
GPL Ghostscript 8.71: Warning: 'loca' length 274 is greater than numGlyphs 136 i
n the font UUGHDE+ArialMT.
GPL Ghostscript 8.71: Warning: 'loca' length 274 is greater than numGlyphs 136 i
n the font UUGHDE+ArialMT.
GPL Ghostscript 8.71: Warning: 'loca' length 188 is greater than numGlyphs 93 in
the font UUGHDE+Arial-BoldMT.
GPL Ghostscript 8.71: Warning: 'loca' length 188 is greater than numGlyphs 93 in
the font UUGHDE+Arial-BoldMT.
Aside from GhostScript, I also have access to PDFTK and ImageMagick (which might be replaced with GraphicsMagick). I'm also open to other solutions.
Development is on WAMP. Deployment is to LAMP.
Suggestions?