- This is not for the faint-hearted.
- If you are not interested in using LaTeX, stop reading now, as this uses the
movie9 packages to embed U3D in a pdfLaTeX generated PDF. This answer assumes basic familiarity with LaTeX. I have tested this with pdfLaTeX and it should work fine in XeLaTeX.
- One of the tools I have used (DAZ Studio) is apparently 'free for a limited time'. It is also not available on Linux. FOSS replacement suggestions are welcome.
- I'm of the personal opinion that 3D in PDF is not as good as it sounds.
What doesn't work
VMD offers the ability to output as OBJ, which can then be processed with FOSS MeshLab into a U3D file that can be embedded into a PDF. This is sub-optimal for two reasons:
There is no way to tell MeshLab that the VMD-generated mesh is supposed to be Gouraud-shaded. This means that the hard facets of the mesh will be glaringly obvious in the pdf, even if you use an unwieldy degree of subdivision.
Colours are not preserved. Your model will appear in the PDF with a uniform grey texture.
As such, MeshLab is not suitable at this stage.
Preparing a model
VMD offers a number of decent export options to get our geometry out of .PDB or what have you and into a mesh format. I opted to use the VRML format to output a mesh of a ribbon representation of PDB entry 4DM9. I then imported this into Blender.
Blender has no reliable U3D export capabilities, however I can use it to assign Gouraud shading to all of the shapes and assign colours to them. I then use the blender export function to export the scene as a Wavefront .OBJ file, with attendant .MTL file.
Processing with DAZ Studio
I am indebted to the author of this article (John Nyquist), which indicated that DAZ Studio can convert Wavefront to U3D just fine, with preservation of textures. DAZ is a very specific program that seems to be heavily geared towards posing, clothing and rendering humanoid figures in the spirit of programs like Poser. However all we really need is the U3D export function and we can read in the structure just fine.
Sometimes, this is how I see myself:
Okay in all seriousness, don't put a human figure in or on your molecule without good reason. Export as U3D and then we can embed in pdfLaTeX.
pdfLaTeX and movie9
As a proof of concept, I just followed the minimal example given in the media9 manual for getting a 3D model into a pdfLaTeX-generated PDF. Here it is, being viewed in Adobe Reader X (I know, I know!). Bear in mind that very few readers can actually display 3D PDF, which is one of the reasons why I feel that it is not such a good idea for chemical visualisation.
It starts off zoomed way too far in because I did not set up any options for the import (however you can find out all about that in the media9 or movie15 package manuals) and is a bit laggy on account of having over 1 million faces (I went way overboard with subdivision), however the important thing is that it works.
Obviously, this is a pretty Rube Goldbergesque route to getting a molecule into a PDF. There probably exist easier ways which should definitely be suggested.