Macros

<< Click to Display Table of Contents >>

Navigation:  PDF-XChange Lite V9 User Manual > PDF-XChange Lite Printer Settings > Save >

Macros


 

Lite-Icon Macros

 


 

Macros can be used when saving files in PDF-XChange Lite. 'Macro' is an abbreviation of 'macroinstruction' - a term in computer science for a rule that specifies how input characters should be entered to create corresponding output. This means that components of the output process can be simplified during the input process, which makes the work involved less intensive and more dynamic. Use macros in the Filename when files are saved in PDF-XChange Lite to create the names of saved files. Note that multiple macros can be used simultaneously as desired. Click the macro button to view the list of macros, then click macros to add them to the text box. Macros can also be entered manually.

 

Please note that certain symbols are not compatible with macros and therefore are not permitted in document names. If inconsistencies are noticed between the name used when files are saved and the final file name then it is advised to change the name used when files are saved.

 

The format for macros is:

 

%[<Macro Name>] or, when it is customizable: %[<Macro Name>:<Parameter>]. The <Parameter> step is optional in all cases except for the Environment Variable macro.

 

An example of the filename that entered macros will create is displayed beneath the File Name text box. For example, if the %[Docpath] macro is entered, then the example displays the source path of the printed document:

 

example.example.macro.new

Figure 1. Example Macro

 

All macros are detailed below:

 

Application Name, which uses the syntax %[AppName] and adds the executable filename extension of the application that calls PDF-XChange Lite to print the document. For example, if Microsoft Word is used then 'WINWORD' is added.

Document Name, which uses the syntax %[DocName] and adds the name of the document. Further information about this macro is detailed below.

Document Path, which uses the syntax %[DocPath] and adds the path of the printed document.

Date, which uses the syntax %[Date] and adds the current date. Multiple date formats are available, as detailed below. Please note that if parameters are not used in conjunction with this macro then the output will be different from what is expected. This is because the output from the default settings includes forwardslashes, which are not compatible with file names. PDF-XChange Standard, the 'full' version of PDF-XChange Lite, contains a range of features for the %[Date] macro. These features require the date in standard format, which is the reason for the format of the default settings and why they do not create the expected output when saving files in PDF-XChange Lite.

Year, which uses the syntax %[Year] adds the current year as a four-digit value.

Month, which uses the syntax %[Month] and adds the current month as a numerical value from 1-12.

Day, which uses the syntax %[Day] and adds the current day of the month as a two-digit value.

Time, which uses the syntax %[Time] and adds the current time. Multiple time formats are available, as detailed below.

Hour, which uses the syntax %[Hour] and adds the hour value from the current time.

Minute, which uses the syntax %[Minute] and adds the minute value from the current time.

Seconds, which uses the syntax %[Second] and adds the seconds value from the current time.

Computer Name, which uses the syntax %[Computer] and adds the name of the local computer as defined by the Windows Computer Name.

User Name, which uses the syntax %[User] and adds the name of the current user.

Page Number, which uses the syntax %[Page] and adds the page number of source pages.

Pages Count, which uses the syntax %[Pages] and adds the number of document pages.

Environment Variable, which uses the syntax %[Env] and adds information taken from user-specified environment variables. This macro must be qualified with a parameter in order to return information. Available parameters are detailed below.

 

%[DocName]

 

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 Lite 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.

 

Available Parameters

 

%[Date]

 

d inserts the day of the month and omits the zero in cases of single-digit values.

dd inserts the day of the month and includes a zero in cases of single-digit values.

ddd inserts the day of the week as a three-letter abbreviation.

dddd inserts the day of the week.

M inserts the month as a numerical value and omits the zero in cases of single-digit values.

MM inserts the month as a numerical value and and includes a zero in cases of single-digit values.

MMM inserts the month as a three-letter abbreviation.

MMMM inserts the month.

yy inserts the year as two digits and adds a zero in cases of values lower than 10.

yyyy inserts the year.

 

Note that several parameters can be used in sequence in order to insert a customized date. For example, %[Date:dddd, dd MMMM yyyy] inserts the day of the week followed by the day of the month, the month name in full and the year as four digits:

 

example.date.macro.new

Figure 2. Example Date Macro

 

%[Time]

 

h inserts the hour and omits the zero in cases of single-digit values.

hh inserts the hour and includes a zero in cases of single-digit values.

H inserts the hour, includes a zero in cases of single-digit values and uses a 24 hour-clock.

m inserts the minutes and omits the zero in cases of single-digit values.

mm inserts the minutes and includes a zero in cases of single-digit values.

s inserts the seconds and omits the zero in cases of single-digit values.

ss inserts the seconds and includes a zero in cases single-digit values.

t inserts a single character to reference the a.m./p.m. variable: A or P.

tt inserts two characters to reference the a.m/p.m. variable: AM or PM.

 

Note that several parameters can be used in sequence in order to insert a customized time, and a range of delimiter options can be used. For example, %[Time:h-mm tt] inserts the current hour and minutes followed by two characters to reference the a.m./p.m. variable:

 

example.time.macro.new

Figure 3. Example Time Macro

 

If parameters are not specified then output values revert to default, which is the time from the local computer in the format hh_mm_ss AM/PM.pdf

 

%[Env]

 

ALLUSERSPROFILE inserts the full path to the All Users profile directory.

APPDATA inserts the full path to the Application Data directory of the current user.

CommonProgramFiles inserts the full path to the Common Files directory.

CommonProgramFiles(x86) inserts the full path to the (x86) Common Files directory in 64-bit versions of Windows.

CommonProgramFilesW6432 inserts the full path to the Common Files directory in 64-bit versions of Windows.

COMPUTERNAME inserts the computer name.

HOMEDRIVE inserts the drive letter on the local computer that is connected to the user's home directory.

HOMEPATH inserts the complete path of the current user's Home directory, as defined by the user's account properties.

LOCALAPPDATA inserts the complete path to the current user's Application Data directory.

LOGONSERVER inserts the name of the domain controller that authenticated the client's logon request.

OS inserts the name of the operating system.

PROCESSOR_ARCHITECTURE inserts the chip architecture of the CPU.

ProgramData inserts the full path to the All Users profile directory.

ProgramFiles inserts the full path to the Program Files directory.

ProgramFiles(x86) inserts the full path to the (x86) Program Files directory in 64-bit versions of Windows.

ProgramFilesW643 inserts the full path to the Program Files directory in 64-bit versions of Windows.

PUBLIC inserts the full path to the Public directory.

SESSIONNAME inserts the session name and number when a client is connected via a terminal server.

SystemDrive inserts the name of the drive on which the system folder was placed.

SystemRoot inserts the name of the system folder.

TEMP inserts the name of the default temporary folder used by the operating system and applications available to the current user.

TMP inserts the name of the default temporary folder used by the operating system and applications available to the current user. (Note that some applications require the TEMP environment variable, whilst others require TMP. The values for both should be identical).

USERDOMAIN inserts the name of the user domain that contains the account of the current user.

USERDOMAIN_ROAMINGPROFILE inserts the name of the user domain for RDS or standard roaming profile paths.

USERNAME inserts the name of the current user.

USERPROFILE inserts the location of the current user's profile directory.

windir inserts the full path to the Windows directory.

 

For example, the macro %[Env:CommonProgramFiles] inserts the full path to the Common Files directory:

 

example.env.macro.new

Figure 4. Example %[Env:CommonProgramFiles] Macro