Logout Developer Knowledgebase Search Adobe Partners Main Adobe Solution Partner Finder Adobe Solution Partner Program Support Developer Knowledgebase Adobe Solution Partner Program Products & Technology Adobe
Developer Knowledgebase

Knowledgebase HomeAcrobat KB

Overview
Software Development Kits
Developer Knowledgebase
Support
Legal Notices
Feedback
Adobe Solution Partner Program
Join
Find a Solution Partner

Product
Acrobat
 
Version
N/A
 
Last Edited
14-May-2002
 
Document
52198

How To: Use PDFMark Operators

Summary
PDFMark operators may be inserted into PostScript code to add features to a document during Distilling.
The PDFMarks may be added to Microsoft Word document print fields to add features to the PDF version of the document when Distilling via PDFMaker. Or PDF Marks may be inserted during Distilling by adding them to the prologue.ps or epilogue.ps files before Distilling begins.

Features that may be added via PDFMark operators include, hyperlinks, named destinations, annotations, bookmarks, etc. Please see Technical Note #5150, The PDFMark Reference Manual, for full details.

What is a PDFMark

The PDFMark operator is used to represent PDF features in PostScript files. When the file is Distilled, these features, such as links and named destinations, appear in the final PDF file.

When using PDFMaker on a PC, many Word features such as hyperlinks can be brought into the PDF file. However, the scope of PDFMarks goes beyond that which PDFMaker can convert from Word into a PDF. If you want to use the more advanced features of PDFMarks, they can be inserted into Word print fields.

Before attempting to do this, you should be familiar with the PDFMark Guide that comes with Distiller and the use of fields within Word. (The Word help file is comprehensive.)

Note: Adobe provides this information as a courtesy. For more information on field codes please consult the Word Help file or other Office documentation.

Using Field Codes with PDFMarks in Microsoft Word


One of the less used features of Microsoft Word is its ability to insert text directly into a PostScript file, via a field. This is similar to a mailmerge or conditional text field, except that instead of different text being displayed in the Word document, the text is hidden, but passed directly into the PostScript file. When used in conjunction with PDFMarks, this can extend the range of features that Word can pass into a PDF file.

The following examples show the use of PDFmarks embedded in print fields to create named destinations or links in PDF files.



How to edit fields in Word

Windows


The F9 key is used to create and edit fields within Word, as is the Insert >> Field menu option. If you have a document that already has fields that you wish to edit, use alt+F9 to view and edit them. To create a new field from scratch ctrl+F9 will create a blank field that you can manually configure.

Macintosh


To insert a field code use Insert >> Field menu option.

To show or hide a field code for a specific document, click the field or field results and press SHIFT+F9.

To show or hide code for all fields in the document, press OPTION+F9.

If you have problems using Option+F9 optimize the toolbar to add the button Show/Hide fields. Consult your Word documentation for instructiono on how to do this.



The print field

The format for a PostScript print field is

{ PRINT \p Group "PostScript" }

The brackets are added by the ctrl+F9 command (Windows) or Insert >> Field (Macontosh); you then type everything else in between.

A simple example would be to use this to enter a named destination into the PDF created from the Word file.

The text for this would be:

{ PRINT \p Group "[/Dest /test_destination /DEST pdfmark" }

This then creates a named destination within the PDF called test_destination on the page on which the print field was placed.

To add a named destination for each page in a Word document, you would do this by putting the print field in the footer, with an embedded field for the page number as part of the destination name.

This print field should look like:

{ PRINT \p Group "[/Dest /page_{ PAGE \* MERGEFORMAT } /Dest pdfmark " }



Step by step guide to producing the above PDFmark

1) In your Word Document open View from the Menu bar and select Header& Footer.

2) Display the Footer

2)From the Menu bar select Insert > Field or press Ctrl+F9 ( Windows)

3) In the Field dialog box select All from the Categories pane and Print from the Field Names pane.

4) click OK.

5) Edit the default Print field code to the following

{ PRINT \p Group "[/Dest /page_ /Dest pdfmark "}

6) place the curser after the underscore of "page_" and insert the Page field code

6a) From the Menu bar select Insert > Field

6b) In the Field dialog box select All from the Categories pane and Page from the Field Names pane.

6c) click OK.

7) the complete script should look now like the following:

{ PRINT \p Group "[/Dest /page_{ PAGE \* MERGEFORMAT } /Dest pdfmark" }


Note: Do not just copy and paste the above example as the brackets will otherwise not be recognised as field codes.

8) Print to Distiller ( Windows) or Create Adobe PDF (Mac)

9) Open the PDF in Acrobat and open the Destination pane

10) Scan the document to view the Destinations



Links

A problem for some customers is PDFMaker’s tendency to convert relative links into absolute links under certain circumstances.

Manually inserting the PDFMarks using a print field can be a workaround for this issue. However, you have to work out the coordinates for the link beforehand and then convert them to points.

The print field in Word uses the standard PostScript userspace, so the bottom left of the page is 0, 0. All coordinates are in points. There are 2.834 (approx) points in a mm and 72 in an inch.

Example:

To create a relative link to a PDF in the same directory you insert the following PDFMark



[/Rect [ 56 330 217 402 ]

/Border [ 16 16 1 ]

/Color [0 0 1]

/Action /Launch

/File (test.pdf)

/Subtype /Link

/ANN pdfmark


The print field will look like:

{ PRINT \p Group "[/Rect [ 56 330 217 402 ] /Border [ 16 16 1 ] /Color [0 0 1] /Action /Launch /File (test.pdf) /Subtype /Link /ANN pdfmark " }

Step by step guide to producing the above PDFmark

1) In your Word document move the curser to any position

2) type ctrl+F9 to add a new Field ( Windows) or use Insert > Field (Macintosh)

3) enter the above field code/PDFmark

Note: Do not type in the outer brackets. These are already given as part of the field code


4) Print to Distiller ( Windows) or Create Adobe PDF (Mac)



How to use PDFMarks in the Real World

All the retyping of PDFMark information will eventually get time consuming, so the best way to manage the process is to create some simple macros that insert the field with the bare bones of the required PDFMark. Once one macro has been created, it will be an easy matter to adapt it to the different kinds of PDFMarks you require.



A word of warning about printing

If you print a Word document with PDFMark codes to printer that does not recognize PDFMarks, they may be treated as errors. You have to print the field codes, insert some PostScript in the prologue of the document, or print from Acrobat to avoid this.

back to top
Was this Knowledgebase document helpful? Yes  No
The articles in this knowledgebase are intended for use by software programmers currently using an Adobe SDK to extend or customize an Adobe product. These articles may be highly technical in nature.
If you have questions about an Adobe Product that are not related to development or an SDK product please visit: http://adobe.com/support/main.html
Copyright © Adobe Systems Incorporated. All rights reserved.
Terms of Use
Online Privacy Policy