11
$\begingroup$

I have recently (perhaps since Mathematica Version 10?) encountered a change in how PDF images are saved and how they behave after being loaded into Adobe Illustrator (v16.0.4 under Mac OS X 10.10.5).

In short: for 2D graphics, Illustrator can edit the graphics--all elements are accessible. For 3D graphics, some rasterization of the graphics is all that is in the exported PDF, and so individual elements cannot be edited in Illustrator.

Here are examples. First, simple 2D graphics:

g = Graphics[
  Line[{{0, 0}, {1, 1}, {0, 1}}]] 

Export from Mathematica to PDF. Open in Illustrator. (Or just copy the graphic from Mathematica and paste into Illustrator.) Then the elements can be edited. Here is a snapshot from Illustrator:


AI2D
Now, 3D graphics:

g = Graphics3D[
   Polygon[{{0, 0, 0}, {1, 1, 0}, {1, 1, 1/2}}]
   ,Boxed -> False];
Export["PDFTestExport.pdf", g, "PDF"]

This is what it looks like within Mathematica:


MmaFig3D
Opening the exported PDF in Illustrator reads in a rasterization, as this snapshot in Illustrator shows:
AI3DRaster
I tried following @Szabolcs suggestion in another thread to use Preview to resave the PDF, but this didn't change matters.

I certainly used to be able to even copy from 3D Mathematica graphics, and paste into Illustrator, with full ability to edit the elements in Illustrator. So something has changed as various software has progressed through newer versions (Mathematica, Illustrator, Mac OS X). I would love the regain that useful editing capability. If anyone has ideas, I would appreciate hearing them.

(Incidentally, exporting to EPS is not a solution: All such files crash my version of Illustrator upon opening.)

$\endgroup$
  • $\begingroup$ Even opening in Acrobat, you can see image is rasterized. I think your best bet will be to export at high res & get paths in either photoshop or Illustrator - probably best in this instance do image processing from those platforms - see here on GDSE. $\endgroup$ – martin Aug 22 '15 at 15:35
  • 1
    $\begingroup$ @martin: Good point, this has nothing to do with Illustrator. It is just that 3D PDF exports from Mathematica now export rasterized images, whereas at some point in the past editable elements were exported. Thanks for the link to GDSE. $\endgroup$ – Joseph O'Rourke Aug 22 '15 at 15:43
  • $\begingroup$ Try to add "AllowRasterization" -> False as an option to your Export. This option is mentioned somewhat cryptically in the MMA documentation to the PDF format, and it has been discussed in an older post on exporting PDF that actually wanted to achieve the exact opposite of what you want, i.e. rasterized 3D export: Exporting graphics to PDF - huge file. Unfortunately I'm on a tablet and can't test it myself. $\endgroup$ – MarcoB Aug 22 '15 at 15:46
  • $\begingroup$ @MarcoB: Good idea, but it is still rasterized! $\endgroup$ – Joseph O'Rourke Aug 22 '15 at 15:56
  • 2
    $\begingroup$ Sigh. I suspected as much. Unfortunately it seems that v.10 has introduced enforced rasterization of 3D graphics when exported to PDF. This has actually come up recently, and I had even participated in that discussion, but couldn't find it before: Export Plot3D in MMA 10.1 is rasterized by default in which a partial workaround was proposed. I wonder if you could test that as well. I'm still on the tablet... :-) $\endgroup$ – MarcoB Aug 22 '15 at 16:06
13
$\begingroup$

I consider this question pretty much answered by @MarcoB, as follows:

  1. Mathematica 10 apparently forces rasterization by default when exporting 3D graphics to PDF, even when one adds the option "AllowRasterization" -> False to Export.

  2. The only way to disable it is to use the Inset workaround suggested by Jens:

    Export["PDFTestExport.pdf", Graphics[Inset[g, Automatic, Automatic, Scaled[1]]]];
    

    Here is how the output is rendered by Adobe Acrobat:

screenshot

  1. A workaround via Print Graphic (also suggested by @Jens) does export the vector elements for 3D graphics ...

  2. ... unless the 3D graphic is too complex (e.g., includes transparency). Then even Print Graphic rasterizes.

$\endgroup$
  • 2
    $\begingroup$ Joseph, thank you for summarizing your findings here. This will be a useful cross-reference. (+1) I'd love to see somebody else come up with an alternative workaround, since being able to export Graphics3D results as vectors would make my day job a lot easier. $\endgroup$ – MarcoB Aug 22 '15 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.