Exporting Links
Existing link annotations from one or more pages can be exported to a comma-delimited ASCII text file. Each link is exported on a separate text line. Link location, extents, appearance and corresponding action are exported. The list of supported actions include: "Go to a page view" (direct page references as well as named destinations are supported), "Go to a page in another document", "Open file", "Open a web page" and "Execute a menu".
The table below describes the output file format used for the link import/export process:
Field Number | Field Type | Field Description |
1 | Integer Number | Page number where a link annotation is located ( IMPORTANT: This is a page number where the link is located, not a destination page number for the link action) |
2 | Single letter | Link highlight mode (N - "None", O - "Outline", P - "Inset"/"Push", I - "Invert") |
3 | Single letter | Link border style (S - "Solid", D - "Dashed", B - "Beveled", I - "Inset", U - "Underline) |
4 | Integer Number | Border width in pixels (0, 1, 2, 3...) |
5 | Integer Number | Annotation flags (XOR of the various system-defined flags). Typically contains information about link visibility. |
6 | Integer Number | Color of the link border. Integer number that combines Red, Green and Blue components into a single value. Same as the output of RGB() macro in C or C++. |
7 | Floating point | X-Coordinate of the left edge of annotation's bounding rectangle, in points. Coordinates are shown in page coordinate system with origin in the lower left corner of the page. |
8 | Floating point | X-Coordinate of the right edge of annotation's bounding rectangle, in points. Coordinates are shown in page coordinate system with origin in the lower left corner of the page. |
9 | Floating point | Y-Coordinate of the top edge of annotation's bounding rectangle, in points. Coordinates are shown in page coordinate system with origin in the lower left corner of the page. |
10 | Floating point | Y-Coordinate of the bottom edge of annotation's bounding rectangle, in points. Coordinates are shown in page coordinate system with origin in the lower left corner of the page. |
>10 | Various | The rest of the fields represent a link action. The format is different for each action type. See reference tables below. |
Format definition for a "Go to a page in this document" action (when using a direct page reference):
Field Number | Field Type | Field Description |
1 | Integer Number | Destination page number (Page numbering starts from 1) |
2 | View Definition | Fit type, view destination rectangle, zoom factor. For example: {XYZ;0.000000;-32768.000000;792.000000;-32768.000000;0.000000}. Value of -32768.0000000 indicates a value that is not set (ignored) in the current view definition. |
Format definition for a "Go to a page in this document" action (when using a named destination):
Field Number | Field Type | Field Description |
1 | String | Destination name starting with @ symbol. For example, @FirstPageView refers to named destination "FirstPageView". |
Format definition for a "Go to a page in another document" action (when using a direct page reference):
Field Number | Field Type | Field Description |
1 | Integer Number | Destination page number |
2 | View Definition | Fit type, view destination rectangle, zoom factor. For example: {XYZ;0.000000;-32768.000000;792.000000;-32768.000000;0.000000}. Value of -32768.0000000 indicates a value that is not set (ignored) in the current view definition. |
3 | String | Relative file path description for a target document. Should always start with file:// keyword. For example: file://mydocument.pdf refers to a file mydocument.pdf that is located in the same folder as a current document. To specify a folder one level below a current one enter the following: FolderName/Filename. For example, file://Help/Index.pdf refers to a file that is located in folder "Help" one level below a current folder (the folder where the originating document is stored). |
Format definition for a "Go to a page in another document" action (when using a named destination):
Field Number | Field Type | Field Description |
1 | String | Destination name starting with @ symbol. For example, @FirstPageView refers to named destination "FirstPageView". |
2 | String | Relative file path description for a destination document. Should always start from file:// keyword. For example: file://mydocument.pdf refers to a file mydocument.pdf that is located in the same folder as a current document. To specify a folder one level below a current one enter the following: FolderName/Filename. For example, file://Help/Index.pdf refers to a file that is located in folder "Help" one level below a current folder (the folder where the originating document is stored). |
Format definition for a "Open a web page" action:
Field Number | Field Type | Field Description |
1 | String | URL address of the destination web page. For example: http://www.cnn.com. URL definitions should always start with http:// keyword. |
Format definition for a "Execute a menu" action:
Field Number | Field Type | Field Description |
1 | String | Adobe Acrobat-specific menu name. For example: menu:FirstPage . Should always start with menu: keyword. There are four standard menu names (also known as "named actions") that are always available in any PDF-compliant viewer: NextPage, PrevPage, FirstPage and LastPage. All other menu names are not guaranteed to be always available. |
Format definition for a "Open a file" action:
Field Number | Field Type | Field Description |
1 | String | Relative file path description for a destination file. Should always start with file:// keyword. For example: file://mydocument.doc refers to a file mydocument.doc that is located in the same folder as a current document.To specify a folder one level below a current one enter the following: FolderName/Filename. For example, file://Help/Index.pdf refers to a file that is located in folder "Help" one level below a current folder (the folder where the originating document is stored). |
How to export link annotations:
1. Open a document that contains link annotations.
2. Select "Plug-ins > Links > Export To Text..." from the menu to open "Export To Text" dialog.
3. Click "Browse..." button to select an output text file name.
4. Optionally, click "Edit Page Range..." button to select a working page range. All links from selected pages will be exported.
5. Click "OK" to start exporting.
Importing Links
Output ASCII text file can edited and later imported back into the same or another document. No new link annotation will be created for a text if there is already another link that covers the same area.
If you are planning to re-import links into the same document or into a document that already has annotations, then make sure you either delete existing annotations or verify that new link annotations are not going to overlap existing ones.
How to import link annotations:
1. Open a document you want to add link annotations to.
2. Delete existing annotations if necessary (use "Plug-ins > Links > Delete Links..." menu).
1. Select "Plug-ins > Links > Import From Text..." from the menu to open "Import From Text" dialog.
2. Click "Browse..." button to select an output text file name.
3. Optionally, click "Edit Page Range..." button to select a page range for the exporting. It is important to understand that selecting a page range for links importing will greatly affect the pages where new links will be added. Each link description record in the text file starts from a page number where this link should be placed. When importing, you have an option to select a page range where to add the new links. The resulting page numbers where links will be created are computed based on a starting page of processing page range. The starting page number is used as offset. For example, you have exported link annotations to a file from the first page of the document. All link description records in this file start with 1, since this is the page number where all links originate from. When importing this file into another document you want to add these new links starting from page 10. You can do this by selecting a processing page range that starts from page 10. The software will automatically compute that page 1 from the export file corresponds to page 10 in the destination document, page 2 to page 11, page 3 to page 12 and so on.
4. Click "OK" to start exporting.