Document Name

<< Click to Display Table of Contents >>

Navigation:  PDF-XChange Standard V7 User Manual > Printer Settings > Macros >

Document Name


 

Main-Image Document Name

 


 

The Document Name macro adds the name of printed documents.

 

The syntax for this macro is %[DocName]

 

Example

 

Follow the steps below to use the Document Name macro to create a watermark that contains the name of the document in text format:

 

1. Click Watermarks in the settings menu, then click Add:

 

macro.appname.1

Figure 1. Watermarks Settings Dialog Box, Add Watermark Button Highlighted

 

The Add/Edit Watermark dialog box will open.

 

2. Clear the Text text box, then click the macro icon and click Document Name in the dropdown menu:

 

macro.docname

Figure 2. Add/Edit Watermark Dialog Box, Document Name Macro Selected

 

The %[DocName] macro is then added to the text box, and the watermark text updates to the name of the document:

 

macro.docname.2

Figure 3. Add/Edit Watermark Dialog Box, %[DocName] Macro Example

 

Note that the preview pane displays the default value, which is the word 'Document.' The watermark text will update to the name of documents when they are printed. For example, if the settings detailed above are used to print a document entitled 'Lorem Ipsum', then it will print as detailed below:

 

macro.docname.3

Figure 4. Sample %[DocName] Macro Output

 

 

Further Information

 

The getDocumentName function of the titrules.js JavaScript uses the document name at the time of printing to define this macro. This JavaScript is included to give PDF-XChange Standard priority over other applications when documents are saved. This is a necessary process because of the complicated manner in which Microsoft defines document names. Please note that modifying the titjules.js JavaScript is a complicated process that only experienced JavaScript programmers should perform. If assistance is required then please Contact Us.