3

My problem concerns PDF not being portable across platforms.

I use these apps: * MacOSX 10.6.8. * Texshop 2.47, right out of the box, nothing customized. Default command is LaTeX. Default script is pdftex. * Adobe Illustrator CS5.

I am writing a long book. Some of the graphics are bitmap images (e.g. TIFFs), that are imported to Adobe Illustrator using "Place." Then I add labels to the Illustrator document, save as EPS, and convert to PDF with Acrobat Distiller X 10.1.3. The bitmap images are not placed as links; they are actually in the Illustrator EPS document. Finally the LaTeX document includes the PDF via \includgraphics and graphicx.

It works perfectly -- for me. The problems are that

  • My friends print the document, e.g. from Mac LionOS or from Windows, and these figures are sometimes blank (other, simpler figures print fine).

  • My other friends view the document on iPad, and the same figures are again blank.

You can find one of the bad figures here:

Illustrator EPS version:

http://www.physics.upenn.edu/~pcn/BadFigs/g113pereiraABClabel.eps

PDF version created by Acrobat Distiller:

http://www.physics.upenn.edu/~pcn/BadFigs/g113pereiraABClabel.pdf

When this was embedded in my LaTeX document, processed by pdftex, and then printed from Mac Preview in OSX 10.7.?, two of the three bitmaps were blank. One bitmap was printed, along with the labels added in Illustrator.

It's hard to know where to begin here, so any general advice is welcomed. Thanks.

Phil Nelson
  • 113
  • 1
  • 7
  • 1
    Can you make one of the eps files available for download? – Ian Thompson Sep 08 '12 at 13:21
  • I add the same request than above but with a PDF file converted from EPS. – Paul Gaborit Sep 08 '12 at 13:26
  • If you have CS5 you can run the Acrobat preflight tool on the PDF to warn you about potential problems. – Lev Bishop Sep 08 '12 at 17:35
  • Ian and Paul: Thanks. I edited the original post to give you an example of the files that generate the issue. – Phil Nelson Sep 08 '12 at 18:20
  • Here is another example:

    http://www.physics.upenn.edu/~pcn/BadFigs/g224hertzLABEL.eps

    http://www.physics.upenn.edu/~pcn/BadFigs/g224hertzLABEL.pdf

    In this case, there is only one placed bitmap, which came out blank when printed. Again, the labels added in Illustrator were OK.

    – Phil Nelson Sep 08 '12 at 18:21
  • Lev: Thanks. I will investigate what Preflight says. – Phil Nelson Sep 08 '12 at 18:21
  • Which version of pdfTeX are you using? And why do you go through eps and Distiller instead of directly saving the image as PDF in Illustrator? – Martin Schröder Sep 08 '12 at 20:38
  • The reference for PDF viewing is Adobe Reader. If other programs show problems, these are most likely bugs in these programs, not in the PDF. – Martin Schröder Sep 08 '12 at 20:39
  • Thanks, Martin. "This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011) restricted \write18 enabled." I, too, suspect that this is an Apple issue, and will ask my readers to try Adobe Reader. Sadly, this won't help the iPad users. – Phil Nelson Sep 08 '12 at 21:18
  • Martin - I missed your other question. The reason I go through eps and Distiller is that saving directly as PDF in Illustrator gives me a bad bounding box. When I do this, the bounding box includes a whole page, not just my graphic. I would be glad to know how to circumvent this behavior, and hence remove Distiller from the workflow. – Phil Nelson Sep 09 '12 at 11:03
  • @PhilNelson For bounding boxes in illustrator use the Artboard tool (shift-O in CS5 for windows). For generally fixing pdf bounding boxes, check out the pdfcrop command line tool. – Lev Bishop Sep 09 '12 at 12:49

2 Answers2

2

Something seems to have gone wrong with the export to eps. According to Encapsulated Postscript files, the first line should just be a version comment such as

%!PS-Adobe-2.0 EPSF-2.0 

but in both of your files there is some trash preceding this. Open the files in a text editor and delete the trash. There is also a very large amount of trash at the end of your files. Everything that follows

%%EOF

can (and should) be deleted. If this doesn't fix the problem, I suggest eliminating Adobe Illustrator from your workflow. It is the work of Satan. You could convert the bitmaps to jpg or png format, include them directly in your LaTeX file, and use the picture environment to add labels as in this answer. This method has the advantage that the font used for the labels will automatically be the same as the font used in the rest of your document.

Ian Thompson
  • 43,767
  • While I agree that illustrator can be problematic (I still use it, because I haven't found something better), I don't think these issues with the EPS are what's causing the problem here, since the EPS successfully distilled to PDF and I can't see obvious problems with the PDF. – Lev Bishop Sep 09 '12 at 01:22
  • @LevBishop Uncompress the PDF file to see "garbage"... – Paul Gaborit Sep 09 '12 at 06:18
  • @PaulGaborit, what "garbage"? Do you mean the xmp metadata? That can't be the problem, because pdflatex \includegraphics will not copy that metadata to the resulting pdf and so the ipads, etc that are causing problems will not even see that metadata. – Lev Bishop Sep 09 '12 at 13:15
1

Your EPS file and your PDF file contain useless informations (thumbnail, preview, etc.). You can try to clean it with GhostScript.

From a PDF file, you can do:

pdf2ps original.pdf original.ps
ps2pdf original.ps original-clean.pdf

I applied this method to http://www.physics.upenn.edu/~pcn/BadFigs/g113pereiraABClabel.pdf and the result is http://perso.mines-albi.fr/~gaborit/g113pereiraABClabel-new.pdf.

Does this new version works better?

Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283
  • This lossily recodes images with the /DCTDecode filter (like JPEG), which may be unacceptable for scientific images (I assume Phil was using TIFF images rather than JPEG for a reason). To refry without lossy compression: gs -o refry.pdf -q -dNOPAUSE -sDEVICE=pdfwrite -dBATCH -dSAFER -dPDFSETTINGS=/prepress -dAutoRotatePages=/None -dDownsampleColorImages=false -dDownsampleGrayImages=false -dDownsampleMonoImages=false -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode g113pereiraABClabel.pdf – Lev Bishop Sep 09 '12 at 13:26
  • @LevBishop When using an iPad or a conventional printer to view images (even scientifc), I think that jpeg compression is not a problem. – Paul Gaborit Sep 09 '12 at 13:35
  • I agree. But often people expect the same PDF to be useful for multiple purposes. It's a pain to have to produce, distribute (and explain to users) that one version of the PDF is intended for ipad viewing and another version is suitable for careful inspection on high-resolution screens with yet another version for book-quality printing, and keep all these versions properly synchronized. As Phil wrote the "problem concerns PDF not being portable across platforms", and achieving this portability can be quite desirable – Lev Bishop Sep 09 '12 at 13:46
  • Thanks Lev and Paul. I'll try this and the other suggestions. Lev is right that ideally I'd like to stick to lossless methods if possible, for the reason he cites. – Phil Nelson Sep 10 '12 at 11:59