How to set up a custom naming convention for PDF files
During conversions it is possible to apply a custom naming convention to the created PDF files using Notes formulas. For example, the PDF files can be stored and named on your file system as <date>_<subject>.pdf
or in any other way needed.
The naming convention needs to be defined for each specific Notes view from which you will be running your PDF exports.
Note: The maximum file path length on Windows is set to 260 characters. Therefore the names of your PDF files together with the full path where they are stored should not exceed 260 characters.
The following example shows how to create a file naming convention for a document view called Sample documents (which is available in the SWING PDF Converter database in the Documentation and Samples section). 1. In the SWING PDF Converter database hit View Settings -> New View Setting in order to create a new View Settings configuration document.
2. In the form which opens up:
Select Any database in the database field
Type "Sample documents" in the View field
Select the Separate PDF files option
Hit the Add button in order to create a new Notes formula (which will be used to generate the PDF file names).
3. In the dialog which appears, type "My naming convention" in the Formula name field and copy the following example formula in the Formula box:
Title + "_ " +@text(@Name([CN];@Author))
4. Click OK and Save and Close the configuration document. The document will now become available in the list of configuration documents in the View Settings view.
5. For a test purpose, you can now open the Sample Documents view in your SWING PDF Converter database, select a few documents in the view, and hit the PDF toolbar icon (if no documents are available in this view you can create them, using the New Document... button).
6. In the conversion dialog which appears, select Separate PDF files in the "To:" menu and My naming convention in the "Name PDFs by" menu, then hit Create PDF.
7. Once the conversion job is completed, you will find the PDF files named according to the naming convention in the destination folder you selected.
In order to accomplish the same for any other database, you first need to know the following:
Location of the database (or choose "Any database")
Name of the document view within this database
Names of Notes document properties which you want to use for the naming convention (e.g. Title, Subject etc.)
With these three points known, you can create a naming convention for any given document views in the same way as described above for the Sample documents view in the SWING PDF Converter database.
Examples
Here are a few typical examples of Notes formulas which can be used in your Notes mailbox:
1. The following formula can be used for emails to name PDF files by delivery date and time and subject, separated with underscore:
@Text(DeliveredDate) + "_" + @Text(Subject)
"DeliveredDate" and "Subject" are typical fields for email documents. For example, a message with subject "Re: Follow-up message" received on December 8th 2011 will be converted to PDF with following file name: 08.12.2011 19 39 31_Re Follow-up message.pdf
2. In this example we removed time, so our file name contains only date and subject:
@Text(@Date(DeliveredDate)) + "_" + @Text(Subject)
The result: 08.12.2011_Re Follow-up message.pdf
3. In this example we decided to format date differently and we included "From" field, now we can see who sent this message without opening it:
@Text(@Year(DeliveredDate)) + "-" + @Text(@Month(DeliveredDate)) + "-" + @Text(@Day(DeliveredDate)) + "_" + @Text(Subject) + "_" + @Text(From)
The result: 2011-12-8_Re Follow-up message_info@swingsoftware.com.pdf
4. This example is slightly different, file name contains form name and date of the conversion:
@Text(Form + "-" + @Text(@Year(@Today)) + "-" + @Text(@Month(@Today)) + "-" +@Text(@Day(@Today)))
The result: Memo-2011-12-9.pdf
5. In this example, the PDF files will be named simply according to their unique document ID:
@documentuniqueid
The result: 9900B68769EDF884C12576DD005CC16E.pdf
Last updated