Customize Output Names of Converted Files

FolderMill offers various ways to set up the naming of output files. This article provides instructions on how to configure naming patterns for files converted by FolderMill.

Adjusting the naming pattern with the Output filename template setting

When splitting a PDF into smaller PDFs or converting documents to image format, such as JPG, PNG, or TIFF, you can change how output files are named. To do it, open the Action's Advanced settings and find the setting Output filename template.

Output filename template in FolderMill

The default output name is: {*SrcFilename}{*WorksheetName}{*SrcFileMPageNo}.{*DstFileExt}

  • {*SrcFilename} – stands for source file name;
  • {*WorksheetName} – stands for worksheet file name (usually applicable for Excel or CAD files);
  • {*SrcFileMPageNo} – stands for source file page number ("M" implies "multiple pages", hence this macro avoids adding page number "1" to single-page files);
  • {*DstFileExt} – stands for destination file extension.

You can modify the output file name template as you like by entering your own text or adding characters like dots, dashes, underscores and the like. Your text can also be combined with macros.

Avoid using the following characters as they are forbidden in Windows filenames:

< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar)
? (question mark)
* (asterisk)

Note: this does not apply to macros. Macros may contain any characters.

Adding built-in macros

Click the {=} icon to access built-in macros that can be added to meet your needs. A macro is a value or expression that pulls data from the metadata of the source file. This data can include the filename, file path, file attributes (such as creation date and time), or other information like the computer or user's name.

Most macros extract data from the source file metadata. If some data is missing from the file, the corresponding macro value will be left out.

Adding built-in macros in FolderMill

You can access all macros through the {=} icon or enter them manually. The macro name will turn light green if entered correctly.

You can combine macros with your own text, including various characters like spaces and dots. For example: 

Item {*SrcFileName}.{*DstFileExt} Created on {*Date(dd.mm.yyyy)}
Macro names are not case-sensitive. That means, both {*dstfileext} and {*DstFileExt} will work the same way.

Modifying the enumeration of output pages/worksheets

When FolderMill processes a document and divides it into pages or worksheets (saved as image files), it assigns numerical endings to their filenames. This prevents a file with the same name from being overwritten each time a new page is saved.

Common scenarios:

  • A multi-page PDF document is converted into an image format (JPG, PNG, TIFF).
  • An Excel or a CAD file with multiple worksheets is converted into an image format (JPG, PNG, TIFF).
  • A PDF is split by the Convert to PDF Action with the Multipage: Split into single pages option enabled.

What is the default enumeration?

By default, file enumeration follows this naming pattern: <Document name>-<Page number>

For instance, it would look like this: Document-1, Document-2, ... Document-10. Thus, a nine-page document would be converted into PNG files as follows:

Converting a nine-page document into PNG with FolderMill

By default, FolderMill automatically adds the so-called leading zeros on certain conditions – based on the total number of pages in a document. 

  • If the number of pages is equal or less than 10, the files will be named file-1.pdf, file-2.pdf, file-3.pdf, and so on.
  • If the number of pages is more than 10 but equal or less than 100, the files will be named file-01.pdf, file-02.pdf, file-03.pdf… file-020.pdf, and so on.

How to add leading zeros to the output file names

You can add more digit positions to the filename and add more zeros to them. For instance, you can alter the naming from "Document-2" to "Document-002".

How to add leading zeros to the output file names

To add more leading zeros:

  1. Next to Output filename template, remove the default macro {*SrcFileMPageNo}.
  2. Instead of the removed macro, click on the {=} icon, navigate to Pages and choose Source file page number, 3 digit number / 001 (or another desired option).
  3. Click OK to save the Advanced settings.
  4. Try converting a few files to make sure the configuration is correct.

As a result, you should get the output files with 3-digit numbers at the end of the filename. 

Output files with 3-digit numbers at the end of the filename

You can modify the {*SrcFileMPageNo(_{0:D3})} macro as you need. For example, change the underscore symbol ("_") to dash ("-") to have names like "A nine-page document-001.png". 

You can increase/decrease the number of leading zeros by manually changing D3 to D2, D4, D5, or D6.

Don't hesitate to contact us if you have difficulty changing the naming pattern or need a custom solution.