Embedding FNV in a PDF
Embedding Resources
Check out this example of embedding in a PDF.
Get the python script here to automate embedding in the source code.
Read Adobe's tutorial on embedding Flash media into a PDF.
About Embedding
One of the nice features of FNV is that it can be easily embedded into an Adobe Portable Document Format (PDF) file transforming a static network image in publications into an interactive one.
Requirements
Embedding Using the Python Script
The first step in embedding a network in a PDF is to download the FNV for embedding folder. Once downloaded, extract all contents of the folder. If you are familiar with the source code you will notice that one of the files GraphMain.as is missing from the folder. You will also notice that an extra file GraphMainIn.as has taken its place. GraphMainIn.as is the file in which the python script, embed.py, will use to create GraphMain.as. It is VERY important that you do not edit GraphMainIn.as if you intend to use the python script for embedding. (If you wish to manually insert a network into GraphMainIn.as then read the next section below.) Double click the python script to execute it. Once the python script is running you will be prompted to enter a file name.

Enter the filename where the network XML file is that you want to visualize and press enter. Once the script executes a new GraphMain.as file with an embedded network should be generated and is ready to be compiled.
Embedding Without Using the Python Script
If you wish to bypass the script you can manually edit GraphMainIn.as. First copy the contents of GraphMainIn.as into a new file and name it GraphMain.as. Secondly find the line with the comment, "//hardcoded network" The next line should contain the text, "var myXML:XML = new XML();". Insert the network between the parentheses in the format of a string, do not forget to escape the quotation marks inside the string.
Compiling the ActionScript files
To compile using Flash CS4 open the FNV.fla file and select test movie. You should now see a FNV.swf file in the directory with your ActionScript files. Double click the FNV.swf file to make sure the network is displaying. If no network is visible make sure that the network XML file embedded has the correct syntax and try again. Once the embedded network is displaying, it is ready to be imported into the PDF.
Inserting the Flash movie in a PDF
Create a new Adobe Acrobat 9 file, select tools->multimedia->flash tool. Draw an area in the PDF where you want to place the FNV. You will then be prompted to browse for the .swf file, find FNV.swf and select it. Select the arrow tool and press the play button to make sure the movie works. If the FNV controls display but no network, make sure that no triangle nodes are in the embedded network, and try again. Once FNV is functioning properly in the PDF you can customize its playback settings by right-clicking on the movie and selecting properties. We recommend setting the activation settings to enable when the page containing content is visible.
Check out this example of embedding in a PDF.
Get the python script here to automate embedding in the source code.
Read Adobe's tutorial on embedding Flash media into a PDF.
About Embedding
One of the nice features of FNV is that it can be easily embedded into an Adobe Portable Document Format (PDF) file transforming a static network image in publications into an interactive one.
Requirements
- An ActionScript compiler compatible with ActionScript 3.0. We recommend using Adobe Flash CS4 Professional or the free Adobe Flex tool.
- Adobe Acrobat Pro 9 or Higher. Without Adobe Acrobat Pro 9 you can not embed a Flash movie in a PDF!
- Optional: Python 2.7 to utilize the automated embedding script.
- A functional network XML file that DOES NOT INCLUDE ANY TRIANGLE NODES! It is very important that no triangle nodes are in the network file as they will cause the embedded network to appear blank inside the PDF.
Embedding Using the Python Script
The first step in embedding a network in a PDF is to download the FNV for embedding folder. Once downloaded, extract all contents of the folder. If you are familiar with the source code you will notice that one of the files GraphMain.as is missing from the folder. You will also notice that an extra file GraphMainIn.as has taken its place. GraphMainIn.as is the file in which the python script, embed.py, will use to create GraphMain.as. It is VERY important that you do not edit GraphMainIn.as if you intend to use the python script for embedding. (If you wish to manually insert a network into GraphMainIn.as then read the next section below.) Double click the python script to execute it. Once the python script is running you will be prompted to enter a file name.

Enter the filename where the network XML file is that you want to visualize and press enter. Once the script executes a new GraphMain.as file with an embedded network should be generated and is ready to be compiled.
Embedding Without Using the Python Script
If you wish to bypass the script you can manually edit GraphMainIn.as. First copy the contents of GraphMainIn.as into a new file and name it GraphMain.as. Secondly find the line with the comment, "//hardcoded network" The next line should contain the text, "var myXML:XML = new XML();". Insert the network between the parentheses in the format of a string, do not forget to escape the quotation marks inside the string.
Compiling the ActionScript files
To compile using Flash CS4 open the FNV.fla file and select test movie. You should now see a FNV.swf file in the directory with your ActionScript files. Double click the FNV.swf file to make sure the network is displaying. If no network is visible make sure that the network XML file embedded has the correct syntax and try again. Once the embedded network is displaying, it is ready to be imported into the PDF.
Inserting the Flash movie in a PDF
Create a new Adobe Acrobat 9 file, select tools->multimedia->flash tool. Draw an area in the PDF where you want to place the FNV. You will then be prompted to browse for the .swf file, find FNV.swf and select it. Select the arrow tool and press the play button to make sure the movie works. If the FNV controls display but no network, make sure that no triangle nodes are in the embedded network, and try again. Once FNV is functioning properly in the PDF you can customize its playback settings by right-clicking on the movie and selecting properties. We recommend setting the activation settings to enable when the page containing content is visible.