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 sort items in a PDF Portfolio.
By default, the initial sort is based on the "Name" field which corresponds to the filename of the IAttachment in the PDF Portfolio. However, you can use the "Specify File Details" panel to set the initial sort to whatever you like (see image to the right). You can even add your own custom metadata fields through this interface or, as I discussed in my previous tutorial, you can add fields through the "Navigator.xml" file.
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 list view (second icon below) of a PDF Portfolio is a completely separate Navigator. This means that everytime a user switches between list view and the Home (first icon below) view, your Navigator is restarting. It is not required but, ideally, your Navigator will account for any changes that were made to the sort order when the user was in the list view. To accomplish this, your Navigator will need to check the sort order when it starts up.
![]()
Here are a few things to keep in mind when implementing sorting in your Navigator.
The Flex project linked to below demonstrates how to determine the sort order of the PDF Portfolio and then how to apply the sort order to the Collection. It also shows how to check if the file can be modified and then set the sort order to whatever you like if that's allowed.
The sort order is determined by the collection.sort array which is an ordered array of ISort instances.The collection.sort property is read/write so it's pretty easy to have your Navigator set the sort order. When sorting the items in the Collection, you also need to be cognizant of the field type in the ISort object. You'll see in the Flex project where I detect text, numeric and date types so that I can apply the correct type of compare function when sorting.
Conclusion:
Download this PDF file and try switching between the home view and list view and changing the sort order. If you have Acrobat 9, try doing it whith the edit panel open and closed and see what happens to the sort order to better understand the concepts in this article.
After downloading this example and compiling the code, you can install the Navigator by following these simple steps.
Windows:
Files:
Download Source