Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exported PDFs from Mathematica 8 won't print

UPDATE: I wrote to Wolfram support about this and will update the post if they can resolve the problem. Sorry for spamming SO with a technical support question, but here it remains in case anyone else is having the same issue.

Is anyone else having this problem with Mathematica 8? I recently upgraded and noticed that when I export Graphics to a PDF file, although the file appears fine on my computer, it prints as a blank page. For example, try

Rectangle[{1,1}]//
Graphics//
Export["~/test.pdf",#]&

which creates a PDF file containing a black square. This file opens fine, but if I send it to my department printer I just get a blank page. If I don't export the graphics but print the notebook from MM, no problem, the graphics print as expected. If I use MM 7 to do exactly the same thing, the PDF file prints as expected. Exporting to PNG in MM8 seems to work fine. And, using the context menu Save Graphics As ... or File > Save Selection As ... to create a PDF containing just the graphic also works. However, these graphics eventually get included in a TeX document, and it would be far better if I could continue using the script I've got that doesn't require any button clicking to generate them.

I'm running MM 8.0.0.0 on Mac OS 10.6.7. I have not been able to test this on another printer yet, but this printer has never given me problems before and prints other PDF documents fine. Any ideas why this is happening?

Wolfram Research responds:

... This issue has been reported by other users as well and our developers are currently looking into it. I have added your details to the report so you can be notified when this is resolved.

In the meantime, the alternatives that you could try are:

  1. Try a different printer.
  2. Rasterize the image with the function 'Rasterize' before exporting. If the rasterized image loses some resolution, you could use the option 'ImageResolution' to edit this.

Rasterize[image, ImageResolution -> xxx]

like image 610
DGrady Avatar asked May 02 '11 17:05

DGrady


2 Answers

Surely this is a bug (please report it to [email protected]), but you can work around the problem by selecting the graphic and choosing File > Save Selection As... from the menu (or Save Graphic As... from the contextual menu). This produces a slightly different file that doesn't appear to exhibit the undesirable behavior we observe from Export[].

like image 157
ragfield Avatar answered Sep 21 '22 12:09

ragfield


These problematic files, and LaTeX PDFs that include them, can be properly printed by Adobe Reader 10.1.2. That's if you're okay with installing and using a 450MB PDF reader.

I reproduced the problem (leading me to this question) with Mathematica 8.0.4.0 on Mac OS X 10.7.2. Wolfram suggested lame workarounds like Rasterize and told me

This issue has been addressed by our developers, and a fix will be included in a future version of Mathematica.

like image 45
ArgentoSapiens Avatar answered Sep 17 '22 12:09

ArgentoSapiens