Embedding 3D objects in PDFs using U3D files

29 Dec 2017

This document describes all the things needed to embed U3D objects into a PDF file in order to generate a 3D PDF.

Requirements

Installing Instructions - Windows

Step 1: Install MiKTeX

Download Link: MikTex

Step 2: Install media9 package

Step 3: Install Adobe Acrobat

Download Link: Adobe Acrobat

How to embed U3D objects

Requirements for making a PDF

For embedding U3D objects you would need to write a .tex file.

This is what the tex file looks like

\documentclass[a4paper]{article}
\usepackage{media9}
\usepackage[english]{babel}
\begin{document}
\setlength{\fboxsep}{0pt}
\setlength{\fboxrule}{1pt}
\fbox{\includemedia[
	label = Object,
	activate = pageopen,
	width = 1\linewidth,
	height = 1\linewidth,
	3Dmenu,
	3Dtoolbar,
	3Dviews = Object.vws,
]{}{Object.U3D}}
\end{document}

Here the .tex file is referencing a views file which defines all the pre-defined bookmarks to how the objects should be viewed

The views file typically has the file extension .vws but a .txt extension would just work as well

This is what the views file typically looks like

VIEW=viewname
	C2W= 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0
	ROO=1.0
	AAC=45.0 
END

Executing the TeX file - Windows

So you need to follow these steps to generate a 3D PDF:

  1. Double-Click on the .tex file and it will open the file with TeXMaker

  2. Click on the green play button for the pdf generation to start

  3. After the pdf is generated it will open up automatically on the default PDF viewer for MikTeX. You won’t be able to see the 3D object in this viewer

  4. Double click on the pdf file generated. It has the same name as the .tex file

OR

  1. Open Command Line

  2. Navigate to the folder which contains the tex file

  3. Execute the following command

>pdflatex name_of_tex_file.tex