Browse > Home / Computer, Data Visualization, How To / Blog article: Embedding a 3D figure into a PDF - dayel.com

Embedding a 3D figure into a PDF

November 9th, 2009 Posted in Computer, Data Visualization, How To

Why use a PDF for 3D?

Some data really needs to be seen in 3D, but how do you easily distribute a 3D diagram? VRML, the erstwhile 3D web standard, seems to have all but disappeared leaving no widely-adopted replacement (O3D not withstanding).

It turns out that Adobe Acrobat reader contains a 3D engine! And since it’s in the ordinary Acrobat Reader, it’s pretty much ubiquitously installed. Here are a couple of examples, with links to two of the 3D pdfs I made for the paper; there are more in the supporting information (view with Acrobat for the 3D to work):

2-D projections (left) and corresponding 1interactive 3-D reconstructions (right) of unconstrained beads (15-µm spacers) showing bilobed and trilobed structure.

In silico network trajectory relative to bead during smooth motion.

How to make a 3D PDF

There are essentially just two steps to making a 3D pdf:

  1. converting your model into the U3D format that acrobat uses, and
  2. embedding that U3D file into a pdf.

Converting VRML to U3D

VTK will produce VRML directly with the vtkVRMLExporter class (take a look at the comet_vtk.cpp file to see how we used it).  Calling comet with a single frame (e.g. ‘comet vtk 200:200’) will write out a .vrml file (see the cometwiki for more details).

To convert the VRML files that VTK produces to the U3D format needed for the pdf you need to buy Acrobat 3D or Deep Exploration (the converter in Acrobat 3D is just a re-branded copy of Deep Exploration anyway). The academic price for Acrobat 3D was only $70, and my fellowship payed for it, but the non-academic price for Acrobat 3D (now called Acrobat Pro Extended) is a rather steep $699.

Embedding the U3D into the PDF

Once you have the 3D models converted into U3D format, you can just copy and paste them into a pdf using Acrobat itself.  This might work if you only have one model, but I actually found using Acrobat to place the models to be surprisingly difficult.  Pasting the model into the pdf result in a model bigger than the page itself, and I couldn’t figure out how to resize other than dragging the corner, which doesn’t preserve the aspect ratio.  It was all very haphazard, and having all the subfigures sized and aligned correctly was nearly impossible.

In the end, I used the LaTeX movie15 package, which I would recommend over Acrobat 3D if you’re at all familiar with LaTeX.  Not only does it allow you to easily size and place all the subfigures correctly, but makes it very easy to have a consistent layout between figures.

One Response to “Embedding a 3D figure into a PDF”

  1. Maybe you’ve seen this already, but Meshlab ( http://meshlab.sourceforge.net/ ) does a pretty good job of converting most standard formats into U3D, and it is open source. I’ve been using vtk+meshlab+movie15 for a few years for sharing x-ray uCT scans, and have had great success with this.

Leave a Reply

*
To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
Click to hear an audio file of the anti-spam word