<< Click to Display Table of Contents >> Navigation: PDF-XChange Standard V9 User Manual > PDF-XChange Standard Printer Settings > Macros > Document Name |
The Document Name macro adds the name of printed documents.
The syntax for this macro is %[DocName]
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:
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:
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:
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:
Figure 4. Sample %[DocName] Macro Output
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 you require assistance in doing this then please Contact Us.