Document Naming Macros in Editor and Standard

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
david king
User
Posts: 16
Joined: Thu Feb 19, 2015 11:14 am

Document Naming Macros in Editor and Standard

Post by david king »

I have encountered some problems with document naming macros when using the Extract Pages function of the Editor to split files. I subsequently checked the equivalent naming macros in the Save Settings of the Standard Printer for comparison. Both products were on version 5.5.315 (licensed PDF-XChange Pro) and running on Windows 10. The following are my observations:

1. %[Date] seems to work properly in both products only if you include the optional date formatting string. Per the PDF-XChange Standard User Manual, the %[Date] macro without a formatting string should render a default format of MM-dd-yyyy; however, neither the Printer nor the Editor do so.

Example:
10-05-2015
Expected result of %[Date] for the date 5 Oct 2015

10\5\2015
String produced by %[Date] in Editor, Extract Pages

10_5_\2015
String produced by %[Date]in Standard, Printing Preferences, Save Settings

Note the Date macro in the Printer adds an extraneous backslash before the year and substitutes underscores for dashes, while the Date macro in the Editor outputs backslashes instead of two dashes. Any backslashes in an output file name will cause unintended subfolders to be generated when the file is saved, as well as affecting the resulting file name. The default form of the macros also fails to output leading 0’s in the Day (or Month) fields in both products --- Day is output as 5 rather than 05. To produce the expected default date format, I discovered that it is necessary to use %[Date:MM-dd-yyyy] rather than just %[Date].

2. Names of some macros are inconsistent between the Printer and Editor; e.g., %[DocName] and %[FileName], %[DocPath] and %[FolderName].

3. The Save Setting page in the Printer includes an Example line which shows what the resulting file name will look like. This feature is very helpful when specifying the output file name with naming macros and can be used to verify the behavior with the Date example above. However, the Example line is missing in the Extract Pages GUI of the Editor and without such a feature to check the file name, the only recourse is to click OK and see what files were produced. In the event of an error in specifying the file name, unexpected subfolders and file names may result.

4. The PDF-XChange Standard v5 User Manual (PDF edition) devotes five pages to explaining the naming macros/fields, including the definition of date and time formatting strings. However, corresponding documentation in the Editor User Manual (EUM) is lacking --- the Extract Pages section of the EUM simply states “The fields are self-explanatory.”

5. To be useful when sorting file names, macros returning number strings, like %[Day], %[Month], %[AutoNumber] and %[Page] need to return a fixed number of digits by including leading 0’s; e.g., (01-09, 10-31) for the Day rather than (1-9, 10-31). With the exception of the %[Date] and %[Time] macros which support formatting strings, the other macros do not return leading 0’s. This makes the Extract Pages function of the Editor less useful for bursting or splitting large documents into multiple separate files since the resulting file names may not easily sort.

6. The %[Page] macro available in the Extract Pages GUI of the Editor is supposed to return the page number of the first extracted page in each output file. However, it behaves inconsistently and this behavior is not documented. If you select n consecutive pages in the thumbnail pane for extraction and then select “Save all extracted pages to one file” as the output type, %[Page] will not return a value and the starting page number will be missing in the name of the resulting output file. However, if you select “Save each pages range to separate file”, the macro will return the expected starting page number.

7. It is not immediately obvious how the %[DocPath] or %[FolderName] macros would be useful in file names, given the presence of backslashes as well as the drive letter of the source document in the generated strings. These characters will cause problems with naming and subfolders when used in file names.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17910
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Document Naming Macros in Editor and Standard

Post by Tracker Supp-Stefan »

Hello david,

Many thanks for your extensive testing and taking the time to report it here.
I have passed this to the attention of our devs so that they can take a look and decide on how we should proceed with getting these things fixed and consistent between products.

Regards,
Stefan
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Document Naming Macros in Editor and Standard

Post by Ivan - Tracker Software »

Many macros' can be customized. For example, Date macro can be customized by date format in format: %[Date:format], where format is date format picture (https://msdn.microsoft.com/en-us/librar ... s.85).aspx)

For example,
%[Date:dd-MM-yyyy] will produce 05-10-2015 for Oct 5, 2015
2. Names of some macros are inconsistent between the Printer and Editor; e.g., %[DocName] and %[FileName], %[DocPath] and %[FolderName].
Macros in Editor and Printer has different meaning, and there were no intention to use the same names.
3. The Save Setting page in the Printer includes an Example line which shows what the resulting file name will look like.
Good point, thanks. Will try to add preview in the Editor where it is possible.
5. To be useful when sorting file names, macros returning number strings, like %[Day], %[Month], %[AutoNumber] and %[Page] need to return a fixed number of digits by including leading 0’s; e.g., (01-09, 10-31) for the Day rather than (1-9, 10-31). With the exception of the %[Date] and %[Time] macros which support formatting strings, the other macros do not return leading 0’s. This makes the Extract Pages function of the Editor less useful for bursting or splitting large documents into multiple separate files since the resulting file names may not easily sort.
Please try %[Page:3] to get 001, 002,... etc.
6. The %[Page] macro available in the Extract Pages GUI of the Editor is supposed to return the page number of the first extracted page in each output file. However, it behaves inconsistently and this behavior is not documented. If you select n consecutive pages in the thumbnail pane for extraction and then select “Save all extracted pages to one file” as the output type, %[Page] will not return a value and the starting page number will be missing in the name of the resulting output file. However, if you select “Save each pages range to separate file”, the macro will return the expected starting page number.
We will try to fix that.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
Post Reply