If you're seeing something other than Verdana, the Font is Graublau Sans Web by FDI fonts.info
This article explains how to add the necessary code to your Navigator to display and edit the metadata for items in a PDF Portfolio. One important fact to point out is that there can be XMP metadata attached to any object in a PDF file though there is no user interface to see it other than the document XMP and XMP associated with images.
The following is a list of software that you'll need to get started with these tutorials. This section is repeated in each article on this topic.
| What You Need: | Where to get it: |
| Adobe Acrobat 9 Pro or Adobe Acrobat 9 Pro Extended |
If you don't already have a copy of Acrobat, you can buy it here. For Windows users, you can download a fully functional 30 day trial here. Sorry - we don't have a trial version for OSX. |
| Flex Builder 3 | You can purchase or download a 60 day free trial of Flash Builder 4 here Note: The Actobat ActionScript API (AcrobatAPI.swc) only works with version 3.0.0 of the Flex SDK. You can download version 3.0.0.477 of the Flex SDK here. The project files in these tutorials will be looking for the name "Flex 3.0.0" in the compiler settings. |
| The Acrobat 9 ActionScript SDK | You can download the complete Acrobat 9 SDK here. The Navigator SDK is part of that. |
| Apache Ant | Again, I like to keep everything in Flex so I use Flex Ant Tasks to zip my files into a Navigator .NAV file. Instructions on how to set this set up are in the next part of the series. |
The pictures below show the document XMP metadata for a PDF file.This information is also stored in the "info" dictionary of a PDF file.


The XMP matadata is not the kind of metadata that this article discusses. In the Acrobat SDK, a PDF Portfolio is referd to as a "Collection" and the files in the portfolio are an array of dataObjects. The Collection fields are the metadata fields and associated content that belongs to the Collection. It is this Collection metadata that you'll see when you look at a PDF Portfolio in the list view (see image below). The reason I bring this up is because the Acrobat ActionScript API does not have assess to the XMP metadata in a PDF file. You can only read and write the Collection metadata.

In Part 2 of this series, I discussed using the "fileName" and "isOpen" properties of an IAttachment. As a reminder, the dataSource for the DataGrid in the example was the currentItems object which is bound to the set of items in the current folder of the PDF Portfolio. Because of this, I could set the dataField for column one to be the "fileName" property and the file name of the item will then show up in the column. I also created a label function that used the "isOpen" property to calculate a label for the second column.
<mx:DataGrid id="itemList" initialize="onInitialize()" dataProvider="{currentItems}"
width="350"
rowCount="12" doubleClickEnabled="true"
itemDoubleClick="itemDoubleClicked(event)">
<mx:columns>
<mx:DataGridColumn dataField="fileName" headerText="Name"/>
<mx:DataGridColumn labelFunction="isItOpen" headerText="File Opened"/>
</mx:columns>
</mx:DataGrid>
There are other usefull string, date, and uint properties that might be useful in your Navigator. Additionally, you can get and set the values of your own custom fields using getFieldValue() and setFieldValue() which I'll discuss a little further down in this article. In the "_04_WorkingWithMetadata" sample file, I added two additional columns to the DataGrid that I've been working with; the "Description" and the 'Title" columns. I'd like users to be able to modify the title and description of any item in the PDF Portfolio so I also made a few other changes to the DataGrid properties which you'll want to look at in the sample code, the most significant one's being that I set the DataGrid to "editable" and set a function for the "itemEditEnd" event.
Like the "fileName" property, the "description" property is standard property of an IAttachment except that it's read/write making it pretty easy to use. You just set the item's "description" property to a new value and that's it. Below is a complete list of all the IAttachment properties you can use in this way.
| children : IList
[read-only] Children of this IAttachment. |
| compressedSize : uint
[read-only] The compressed size (in bytes) of the file. |
| creationDate : Date
[read-only] The creation date of the file. |
| description : String
Sets or gets the file description. |
| fileName : String
The last segment of the path property. |
| icon : Bitmap
[read-only] Gets the icon representation of the file according to the file type. |
| isFolder : Boolean
[read-only] true if this IAttachment represents a folder; false otherwise. |
| isOpen : Boolean
[read-only] true if the attachment is open; false otherwise. |
| modDate : Date
[read-only] Gets the modification date of the file. |
| parent : IAttachment
The parent of this IAttachment. |
| path : String
[read-only] The attachment's path within the package. |
| size : uint
[read-only] Gets the uncompressed size (in bytes) of the file. |
| thumbnail : Bitmap
[read-only] A thumbnail representing the attachment. |
The Acrobat ActionScript API does not allow Collection fields to be added to or removed from the Collection. To add additional fields to a Collection, you'd need to use the "navigator.xml" file. The "initialFields" element is used to both add new custom fields, "Title" in the case below, and define the set of fields visible when looking at the PDF Portfolio in the list view as well as their order. You can also use "sID" attributes to localize the "name" that shows up in the detail view column heading.
<initialFields>
<field name="Name" type="filename"/>
<field name="Title" type="text" editable="true"/>
<field name="Description" type="desc" editable="true"/>
</initialFields>
Note: These custom fields will be added to the Collection when the user mearly selects your layout even if they switch to another layout and do not save your layout to that Collection.They cannot be programatically removed using the Acrobat ActionScript API once added.The JavaScript API can be used to remove collection fields or they can be removed through the Acrobat UI.
With the custom field now available in the PDF Portfolio, you can use getFieldValue() and setFieldValue() to get and set the value of the field.
After downloading this example and compiling the code, you can install the Navigator by following these simple steps.
Windows:
Files:
Download Source