File formats/3D PDF
Contents
PDF documents with integrated 3D interactive models
Easy procedure
This is currently the easiest way to create a PDF document containing an interactive 3D molecular model, using only free software (at least free in Windows; solutions for the Mac need more investigation to confirm).
Downloads
- Windows and MacOS: download the graphic user interface version of IDTFConverter from the Jmol website:
- Windows: download the
IDTF_U3D_Converter.zip, unpack the zip file and put the single
IDTF_U3D_Converter.exe file wherever you want in your local disk. If you find it convenient, create a shortcut for it in the desktop or the Start menu. - MacOS: choose and download the app suitable for your system:
IDTF_U3D_Converter_Intel.zip if your computer is based on an Intel processor. Unpack the zip file to obtain the executable file,
IDTF_U3D_Converter.app
IDTF_U3D_Converter_Silicon.zip if your computer is based on a Silicon processor (usually ARM). Unpack the zip file to obtain the executable file,
IDTF_U3D_Converter.app
- Windows: download the
Create the IDTF file
- Get a current version of Jmol application. Open your molecule; display it in the desired orientation and style.
- Suggestion: make the Jmol window square, using
top menu > Display > Resizeand entering two equal numbers. The result will look better if you insert it later into a square box within the pdf. - Note: you can also do it with JSmol embedded in some webpage. Generation of the idtf file may take longer, though, if the model is complex.
- Suggestion: make the Jmol window square, using
- If the export to IDTF option has been implemented in the menu:
- Top menu bar >
File > Export > Export to IDTF - Pop-up context menu >
File > Export > Export IDTF 3D model
- Top menu bar >
- Otherwise, open the console and enter
write myMol.idtf - Two files will be created:
myMol.idtf and
myMol.idtf.tex. For the current method, you may discard the .texfile.
Create the U3D file
- Open the IDTF_U3D_Converter program or app, browse to load your
.idtf file, choose the output folder and click on "Convert". The output will have the same filename as the input, with extension
.u3d
Prepare your PDF document
- Use your preferred program (word processor, presentation, ...) to create a document with text and images, leaving square space(s) where you will later insert the 3D molecular models, and export to pdf format.
- If your application cannot export to PDF directly, you may use a virtual PDF printer like PDFforge PDF Creator or PDF-XChange Lite Printer (both available for free).
- To insert the 3D models you need a pdf editor that is compatible with the 3D-PDF standard. Examples: Adobe Acrobat Pro and PDF-XChange Editor (Windows-only, free or paid version)
- In PDF-XChange Editor: open the previous PDF, find the place where your left blank space. To insert a 3D annotation there:
- If you are using the Ribbon interface:
Comment > Add 3D - If you are using the classical Toolbar interface:
Tools > Media tools > Add or edit 3D annotations - Draw the rectangle area with the mouse. Suggestion: draw a square by holding the Shift key while dragging to define the area.
- In
3D Artwork, select your
myMol.u3d file. - Choose among any other display options offered (like activation of the content, border and background color)
- Accept and save the file.
- If you are using the Ribbon interface:
- In Adobe Acrobat Pro: open the previous PDF, find the place where your left a blank space. To insert 3D media there:
- From the upper left of the screen, select
All tools > Add rich media > 3D media. - Drag a rectangle (better, a square) to define the area for the 3D model. An Insert 3D dialog box appears.
- In the
Insert 3Ddialog box, browse to select your
myMol.u3d file. Check Show Advanced Optionsto set the initial properties. - Adobe help for this procedure.
- From the upper left of the screen, select
Viewing the result
- Check the 3D display in a PDF viewer application. Note that not all viewers support this kind of 3D content. At least, Adobe Acrobat Pro, the free Adobe Reader, and PDF-XChange Editor support 3D objects. The pdf viewers implemented internally in web browsers do not currently support 3D objects and will just display a static image.
- In Android devices you may use '3D PDF Viewer' or possibly other apps (search the Google Play store).
- In iOS devices you may use '3D PDF Viewer' (search the App Store) or possibly other apps. This may also be run in a Mac computer.
Sample documents
These have been created following the above procedure
Note the model will not display as 3D and interactive if you view it inside the web browser; you need to download the file and open it in a compatible PDF viewer.
Older reference
Installations
Jmol
You need at least version 12.0.RC26 to do this.
IDTF to U3D
(See also descriptions and comments for Jmol output to IDTF and U3D formats.)
Conversion from IDTF to U3D can be done using a simple command-line utility, IDTFConverter.
- Windows installation of IDTFConverter
- The converter is available from Universal 3D Sample Software [ref.1 below] and from Michail Vidiassov's site [ref.2 below]. Download the latest
U3D_A_??.zip file. You only need a subset of the files in that package:
- Extract (unzip) the contents of
Bin/Win32/Release/ (that makes 4.46 MB out of the total 137 MB in the zipfile). From that, - You need (minimal functional set of files):
IDTFConverter.exe,
IDTFExporter.dle,
IFXCore.dll and the
Plugins folder - You do not need:
HelloWorld.exe,
SamplePlayer.exe,
TrueType.exe - A
readme.txt file may be useful documentation, not essential.
- Extract (unzip) the contents of
- Put those extracted files and folder in a location of your convenience, like
c:\idtf\ - In that location, create a simple command file
u3d.bat. This plain text file must contain this text:
idtfconverter.exe -input %1.idtf -output %1.u3d
- Then put in that same location the
.idtfand.idtf.texfiles you want to convert (produced by Jmol), open the command line window (a.k.a. terminal) in that location and typeu3d yourFileName(do not include the extension)
- That will generate the corresponding
.u3dfile
- MacOS and Linux installation of IDTFConverter
- You can get a port of IDTFConverter from Michail Vidiassov's site (ref.3 below).
- Create a command file similarly to the one described for Windows.
References
- Windows: Universal 3D Sample Software (at SourceForge). Go to 'View All Files' and download the latest
U3D_A_??.zip - Windows: Alternatively, get just the necessary files from (broken link) http://www2.iaas.msu.ru/tmp/u3d/u3dIntelWin.zip (thanks to Michail Vidiassov).
- MacOS and Linux: A port of the software is available as
u3d-1.2.852.tar.gz or, possibly, a newer version, at (broken link) http://www2.iaas.msu.ru/tmp/u3d/ (thanks to Michail Vidiassov).
- A listing of what used to be at Michail Vidiassov's site (without any files) in 2017.
- A downloadable source code of version
u3d 1.4.4, dated 2013. This may or not be the same software package.
LaTeX to PDF
There are several pdfLatex software, like teTeX (Unix; discontinued in 2006), MiKTeX (Windows), TeX Live (Unix, Linux, Windows), MacTeX...
- Installation of MiKTeX (Windows)
- Download and install MiKTeX "basic" from http://miktex.org/
- Do an update (menu
Programs > MiKTeX > Maintenance > Update). - Download the movie15 package (menu
Programs > MikTex > Maintenance > Package Manager).
- You can avoid installing software and use instead an online service like ScribTeX (they have a Free Plan that gives you 50 MB storage space; you can even test-run it without signing up).
Creating the document
1. Within Jmol script console: write c:/temp/xxx.idtf
Note: by default, the final PDF will be a letter-sized page (215.9×279.4 mm, 8.5×11 inches). If you want instead an A4-sized page (210×297 mm), edit now the
xxx.idtf.tex file, look for the line that says
documentclass[12pt,letter]{article}
and replace with
documentclass[12pt,a4paper]{article}
2. At the system command line or terminal, call the
u3d.bat file (Windows), or equivalent MacOS or Linux command file, to convert the
.idtf to
.u3d format:
u3d c:\temp\xxx
If using MikTeX:
- 3.2. Click menu item
Typeset > Typeset, or click on the green 'play'-like button (leftmost in the toolbar). - When processing ends, you will see a blank document in a new TeXworks window, because MiKTeX can't display the model, but
xxx.idtf.pdf should have been created.
If using ScribTeX:
- 3.1. Go the ScribTeX website, sign up or use the guest account.
- 3.2. Click on [
Upload file] and select in turn your
xxx.idtf.tex and
xxx.u3d files (or a
.zip file containing both, it will be automatically unzipped in the server).
- 3.3. In the file listing on the server, click on the
xxx.idtf.tex file to display it, then click on [Compile].
- 3.4. When the
.pdf file opens in the browser, click on the [Save copy as] button in your viewer's toolbar, to store it in your local disk.
4. Open the
.pdf file using a reader/viewer that supports 3D PDF (see a list below).
- If you don't see the model in its panel inside the document, right-click on it and choose
Partial options > Fit visible
Caveats
- If you move in Jmol the model rotation center away from screen center (as with CTRL-ALT-drag), the model in the 3D PDF will be a very close but not quite perfect reproduction. (The reason for this is that moving the center of perspective seems to be not supported in virtual reality formats like VRML and U3D.)
- Lighting is not working properly: the light moves with the model. If someone knows how to do that, please let us know.
- Perspective canot be orthographic from the beginning (Jmol uses this by default for crystal structures). Once in the 3D PDF, there is a right-mouse-button option to go into that mode. Please let us know if you know how to do that.
- Don't expect rotation and translation using the mouse in the 3D PDF to be like in Jmol. It is harder to control, and you can even completely loose the rotation center.
- For large models (big proteins, surfaces, electron density maps), files are quite big, and seeing and manipulating the model in the PDF will need substantial computer power. To alleviate this, you can try to set the image frequency to a lower value in the Reader's 3D options and/or to change the optimisation method for small frequency to 'Abandon'. Also, if you are using it in a presentation, it is a good idea to preload the PDF document in the Reader ahead of time.
Documents with text
In order to have text, images etc. alongside the 3D model, ideally you need a full PDF editor, which is normally commercial like Adobe Acrobat Pro.
As an alternative, some of the freeware PDF viewers, like PDF-XChange Editor, allow you to add text and images onto the generated 3D PDF and save the modified document.
The best freeware way to create a full pdf-presentation including 3D objects, text and other images is by using pdflatex with the Beamer package. See the Beamer wikipedia page for more information about Beamer.
Sample documents
(Text in these documents has been added externally to the process described here.)
- 3D PDF with an organic molecule, ball and stick.
- 3D PDF with a small protein, crambin (1crn.pdb), in cartoon rendering.
- 3D PDF with a polyhedra rendering of quartz.
- 3D PDF with a carbon nanotube, ball and stick and molecular surface.
Software for creating or viewing 3D PDF
(This aims to be a compilation of resources; if you know of another software, please add it here).
3D PDF Viewers
- Adobe Reader v.7 or later (proprietary, freeware). Note that the latest Adobe Reader v.9 renders the 3D object more nicely than v.8 and v.7. In v.9 it is possible to remove the compass that appears by default in the lower left corner via the Reader's 3D content options.
- Display of 3D objects may be disabled by default. You may enable it either by trusting the document or by setting: Preferences > Multimedia & 3D > Enable Playing of Multimedia and 3D content.
- PDF-XChange Editor v.7.0.327 or later (from PDF-XChange Co. Ltd., formerly Tracker Software; proprietary, there is a free version). It can display 3D models embedded in the PDF if they were created in the U3D format (but currently not if created in the PRC format).
- Foxit PDF Reader version 12 or later includes support for displaying embedded 3D models. For previous versions 9, 10, 11, you need to install the 3D plug-in. Note: support and performance are poorer, in our hands, than with PDF-XChange.
- Display of 3D objects may be disabled by default. You may enable it either by trusting the document or by setting: File > Preferences > 3D > Enable the playing of 3D content.
- Tech Soft 3D PDF Reader, for Android systems (supported on Android version 4 and up, but unsupported on version 9, maybe before)
- Most other PDF viewers are not able to display interactive 3D data.
3D PDF Editors
- Adobe Acrobat Pro Extended (proprietary, commercial).
- Note that you do not create the 3D model using Adobe; you just insert or embed it from an available
u3d file that you have prepared with another software (like Jmol + IDTFConverter). The Adobe editor will mainly serve to position the 3D model within the page and to insert the other content of the document.
- PDF-XChange Editor v.8.0.332 or later (from PDF-XChange Co. Ltd., formerly Tracker Software) can insert a 3D model from a U3D format file in an existing pdf document. This is possible both with the free and paid/licensed versions. If you have the licensed version, you can also do it with a newly created blank pdf document.
- Foxit PDF Editor Pro (not free software) allows to insert a 3D model (in either
u3d or
prd formats) to a PDF page. Note that Jmol can only produce
u3d files, not
prd files. - Share3D PDF, by Quadrispace, looks like a promising solution to easily produce 3D-containing pdf documents at a reasonable price and with a nice set of features. Unfortunately, it doesn't seem to import any of the 3D formats that Jmol can produce.
- U3D-2-PDF seems to be a user-friendly freeware tool that drives MeshLab and MiKTeX to facilitate the procedure from a
wrl file to a
pdf document. (Requires MiKTeX, MeshLab and .NET Framework 4 installed; all freeware) - Aspose offers a free online converter that will create a
pdf document with the 3D model embedded, from an
obj+mtl pair of files generated by Jmol. The result is not very satisfactory: model is zoomed in far to much to be visible, with no hints for the user to zoom out. Choose PDF in the "save as" drop-down menu. The document will be of US-letter size.
Bibliography
Related articles:
1. Grasping molecular structures through publication-integrated 3D models.
- (2008) P. Kumar, A. Ziegler, J. Ziegler, B. Uchanska-Ziegler & A. Ziegler. Trends in Biochemical Sciences 33:408-412.
- doi:j.tibs.2008.06.004
- 3DPDF version of the article (3.63 MB)
- Here, we describe how an interactive 3D model of a molecular complex can be embedded directly into a PDF, thus providing readers with important and educational visual information that would otherwise be more difficult to disseminate.
- They use Pymol + Adobe to produce the 3D PDF.
2. A step-by-step guide to creating PDF-integrated 3D models.
- (Published online as Supplementary Material to #1)
- Part 1: PyMOL ~ Part 2: Adobe 3D Reviewer ~ Part 3: PDF Export (Acrobat 9 Pro Extended)
- http://www.charite.de/immungenetik/model3d.html
- Pymol exports to VRML2; Adobe 3D Reviewer imports that and exports to U3D; Acrobat 9 Pro Extended is used to insert and finish off the 3D model in the PDF.
3. Incorporating interactive 3-dimensional graphics in astronomy research papers.
- (2008) D. G. Barnes, C. J. Fluke. New Astronomy 13:599-605.
- arXiv:0709.2734; doi:10.1016/j.newast.2008.03.008.
- related wiki article.
- The authors use the three dimensional plotting library S2PLOT to write a 3D object to VRML97 format and use then Adobe Acrobat 3D to embed it in a pdf document.
4. Leaving the structural ivory tower, assisted by interactive 3D PDF.
- (2010) P. Kumar, A. Ziegler, A. Grahn, C.S. Hee, A. Ziegler. Trends Biochem. Sci. 35:419-422 doi:10.1016/j.tibs.2010.03.008.
5. Embedding and publishing interactive, 3-dimensional, scientific figures in portable document format (PDF) files.
- (2013) D. Barnes, M. Vidiassov, B. Ruthensteiner, C. Fluke, M. Quayle, C. Colin. PLOS One 8:e69446 doi:10.1371/journal.pone.0069446.
- They do not use the U3D format, but PRC instead.
6. Towards an easier creation of three-dimensional data for embedding into scholarly 3D PDF (Portable Document Format) files.
- (2015) A. Newe. PeerJ 3:e794 doi:10.7717/peerj.794.
7. Enriching scientific publications with interactive 3D PDF: an integrated toolbox for creating ready-to-publish figures.
- (2016) A. Newe. PeerJ Comput. Sci. 2:e64 doi:10.7717/peerj-cs.64.
8. On the use of PDF-3D to overcome spatial visualization difficulties linked with ternary phase diagrams.
- (2019) D. Vergara, M. P. Rubio and M. Lorenzo. Education Sciences 9:67 doi:10.3390/educsci9020067.
- Reports on generating 3D-PDF via OBJ file to (Adobe Photoshop) U3D to (Adobe Acrobat) PDF. Note: Jmol can export models to the OBJ format.