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

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 real­ly needs to be seen in 3D, but how do you eas­i­ly dis­trib­ute a 3D dia­gram? VRML, the erst­while 3D web stan­dard, seems to have all but dis­ap­peared leav­ing no wide­ly-adopt­ed replace­ment (O3D not with­stand­ing).

It turns out that Adobe Acro­bat read­er con­tains a 3D engine! And since it’s in the ordi­nary Acro­bat Read­er, it’s pret­ty much ubiq­ui­tous­ly installed. Here are a cou­ple of exam­ples, with links to two of the 3D pdfs I made for the paper; there are more in the sup­port­ing infor­ma­tion (view with Acro­bat 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 essen­tial­ly just two steps to mak­ing a 3D pdf:

  1. con­vert­ing your mod­el into the U3D for­mat that acro­bat uses, and
  2. embed­ding that U3D file into a pdf.

Converting VRML to U3D

VTK will pro­duce VRML direct­ly with the vtkVRM­L­Ex­porter class (take a look at the comet_vtk.cpp file to see how we used it).  Call­ing comet with a sin­gle frame (e.g. ‘comet vtk 200:200’) will write out a .vrml file (see the cometwiki for more details).

To con­vert the VRML files that VTK pro­duces to the U3D for­mat need­ed for the pdf you need to buy Acro­bat 3D or Deep Explo­ration (the con­vert­er in Acro­bat 3D is just a re-brand­ed copy of Deep Explo­ration any­way). The aca­d­e­mic price for Acro­bat 3D was only $70, and my fel­low­ship payed for it, but the non-aca­d­e­mic price for Acro­bat 3D (now called Acro­bat Pro Extend­ed) is a rather steep $699.

Embedding the U3D into the PDF

Once you have the 3D mod­els con­vert­ed into U3D for­mat, you can just copy and paste them into a pdf using Acro­bat itself.  This might work if you only have one mod­el, but I actu­al­ly found using Acro­bat to place the mod­els to be sur­pris­ing­ly dif­fi­cult.  Past­ing the mod­el into the pdf result in a mod­el big­ger than the page itself, and I couldn’t fig­ure out how to resize oth­er than drag­ging the cor­ner, which doesn’t pre­serve the aspect ratio.  It was all very hap­haz­ard, and hav­ing all the sub­fig­ures sized and aligned cor­rect­ly was near­ly impos­si­ble.

In the end, I used the LaTeX movie15 pack­age, which I would rec­om­mend over Acro­bat 3D if you’re at all famil­iar with LaTeX.  Not only does it allow you to eas­i­ly size and place all the sub­fig­ures cor­rect­ly, but makes it very easy to have a con­sis­tent lay­out between fig­ures.

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

  1. May­be you’ve seen this already, but Mesh­lab ( ) does a pret­ty good job of con­vert­ing most stan­dard for­mats into U3D, and it is open source. I’ve been using vtk+meshlab+movie15 for a few years for shar­ing x-ray uCT scans, and have had great suc­cess 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