3d pdf

From PyMOLWiki
Revision as of 04:23, 5 October 2011 by Speleo3 (talk | contribs) (rearrange some tex to avoid dropping comma)
Jump to navigation Jump to search


PyMOL can convert to formats (vrml2 and idtf) that can be converted to a 3D PDF (will not work with most PDF browser plugins; must be downloaded and viewed with certain viewers liked Adobe Acrobat 9.2+).


\title{PyMOL 3D Objects in PDF}
\author{Jason Vertrees}
        toolbar, %same as `controls'
        % replace the next line with what PyMOL output
        3Daac=20.0, 3Droll=0, 3Dc2c=0 0 1, 3Droo=62.45, 3Dcoo=0 0 -62.45
\label{ex3d} A PyMOL object embedded in PDF, using U3D data format.


  • Save your molecule to an IDTF file in PyMOL:
save pymol.idtf, *

PyMOL will print a line that looks like:

 3Daac=20.0, 3Droll=0, 3Dc2c=0 0 1, 3Droo=62.45, 3Dcoo=0 0 -62.45

copy this line into the pymol.tex file overwriting the same line in the file.

  • Convert the IDTF to U3D:
 ./IDTFConverter -input pymol.idtf -output pymol.u3d
  • Create the PDF using LaTeX:
 pdflatex pymol.tex


  • Currently you have to compile the u3d converter on Linux. I did that with:
cmake .

which created "IDTFConverter" that I used above.

  • Some versions of Acrobat on Linux incorrectly parse the 3D data. Adobe knows about this and plans to fix it. Ironically, I created a 3D PDF on Linux but could only view it on Mac OS X.

More on 3D PDFs