If you're seeing something other than Verdana, the Font is Graublau Sans Web by FDI fonts.info
Skills Required: Flex, ActionScript, Acrobat 9
One of the great new features of Adobe Acrobat 9 Pro and Pro Extended is the ability to add SFW based Rich Media Annotations (RMAs) developed in Flash or Flex. These SWF files can be placed in a PDF file using the new Flash Tool in Acrobat 9 and play using the built-in Flash Player. The built-in player provides greater security and consistency for Flash playback inside any PDF file. For those of you that attempted to use Flash in a PDF with earlier versions of Acrobat, you'll remember that the user experience wasn'tât all that great. Acrobat 9 provides tight integration between the PDF document and the RMAs well as other content types that run in the Flash Player such as FLV and H.264 encoded video.
There are two ways to play the RMA in a PDF file, on the page or in a floating window.
|
![]() When the RMA is played on the page, you are able to use the Acrobat commenting features to review and markup the interactive content. |
If you've got a Rich Media Annotation (RMA) that communictes with a web service, you may want to enable users to export the data for use in other applications. Due to security restrictions, the RMA (and Acrobat in general) can't write directly to a file on the user's hard drive. Instead, the RMA would create a new attachment in the PDF file and then launch that.
In the example file shown on the right, the RMA gets the chart data from a web service. When the user clicks the "Export Data" button, The data in the form of an XML file opens in the system's default XML editor.
Because this action requires modifying the PDF beyond what can be enabled with Reader Extensions, it only works in Acrobat Standard or higher, not in Reader.
To accomplish the data export, I used a similar technique to the one I used in my Inter-RMA Communication article to move the data across the JavaScript/ActionScript bridge and set it as a variable in Acrobat that I can later use in a second method. The second method does the actual export.
The Acrobat JavaScript used to save the file is below. The variable "chartData" is a hex encoded version of the XML data file that drives the chart. To make it easier to pass across the JavaScript/ActionScript bridge I first encoded it to Hex in the RMA using ActionScript. This lets me easily use Acrobat's "eval" method without worrying about quote characters or line endings.
The JavaSCript creates the file as an attachment to the PDF, launches the attachment, and finally deletes it from the PDF file. At this point, you can simply save the exported file to your drive.
function saveDataToAttachment()
{
this.createDataObject("results.xml", decodeFromHex(chartData));
this.exportDataObject({ cName: "results.xml", nLaunch: 2 });
this.removeDataObject("results.xml");
}
Again, just like in the Inter-RMA Communication article, the JavaScript is stored in the RMA and is triggered by an event in the RMA, this time the "Export Data" button.
Open the Example PDF file
Download the Flex Project for the RMA in the example