Using GDI Print Directives

<< Click to Display Table of Contents >>

Navigation:  GDI Print Directives >

Using GDI Print Directives

//PDFX, class.subclass {.subclass}, value {,value,…}

Using //PDFX directives in a properly configured and licensed PDFX environment, programmers can automatically produce PDF documents that have specific characteristics and which cause certain things to happen—e.g., email, save with a particular filename, show or don't show finished document to user, etc. All these types of controls are managed through the GDI directives, which are documented here.

When using the PDFX GDI directives, note the following:

As with all GDI directives, the lead-in for PDFX is double slash ( // ). A double slash followed by a semi-colon indicates a comment, and the line is ignored by A-Shell—although it may be useful in understanding what you were trying to accomplish (e.g. //;the following directive is a mystery to me).
The PDFX lead-in cannot contain any spaces; the directive "//  PDFX..." will result in the desired directive not being recognized as such, instead appearing as plain text in the output.
The PDFX directives are case sensitive. Alternate forms may be accepted in some cases, but you should strive to match the case as documented.
Hex values in the form &h#### are supported, although this only applies to color specifications.
A-Shell does not perform any validation on the PDFX directives; the directives are simply passed to the driver if the driver is PDFX. In the absence of the PDFX (i.e., the report is directed to some other printer), PDFX directives are still legal but will be ignored. If the driver does not recognize the directive, it may return a code that causes A-Shell to print the directive as text. In other cases, the driver may just ignore the directive. Note also that no error message or other feedback is provided when a command fails due to improper spelling, punctuation, syntax, etc.
Also in keeping with GDI conventions is the handling of strings. When entering strings, you MAY quote the entire string (i.e., enclose it with double quote marks), but you only MUST quote the string if it contains commas. Always enclosing strings in quotes eliminates the possibility of the stray or unusual comma causing the string to be truncated at the point of the comma.
The order in which directives are entered is usually optional, although there are some exceptions, such as Email.Content.
In some cases, the form or spelling of the directive differs between PDFXv3 and later versions (PDFXv5+). In such cases, the PDFXv3 version will be automatically converted to the PDFXv5+ equivalent when applicable. The tables of directives are organized by the v5 names, but contain cross references to the v3 names when applicable.
In the following tables of directives, note that many of the values are shown in quotes. This means that the quoted values are valid entries for that directive. The value entry 0 ("AllOpened"), for example, means that when specifying this value you can use either "0" or "AllOpened".

The PDFX variables fall into several categories, as shown in this document's table of contents. The category keyword, with which all directives in that category begin, gives an indication of the type of control offered. See those topics for information on the category (what is "Downsample"?), as well as syntax, values and descriptions for the individual directives.

Examples

Here are a few examples showing PDFX directives from an actual print file.

Command

Result

//PDFX,DocInfo.Title,"Test PDFX1"

Specify doc title

//PDFX,Save.ShowSaveDialog,0

Do not display Save dialog on completion

//PDFX,Save.RunApp,0

Do not run Acrobat on completion

//PDFX,Save.WhenExists,1

Automatically overwrite doc if it already exists

//; this is a comment

//; indicates comment; rest of line ignored

//PDFX,Security.Enabled,1

Enable security

//PDFX,Security.UserPwd,jack

Set user password (for opening the document)

//PDFX,Email.Method,5

Invoke PC's default mail client

//PDFX,Email.Subject,Testing PDF

Insert "Testing PDF" as subject in email message

//PDFX,Links.Enabled,1

Convert text that looks like links into actual links