Please enable JavaScript to view this site.

Navigation: Using Win2PDF and Win2Image > Document Settings > Auto-name Files and Configure File Save Naming

Content Based File Naming

Scroll Prev Top Next More

Win2PDF allows the file to be named based on the contents of the PDF file.  This can be helpful if the application generating the PDF can't be changed to use the Win2PDF developer interface to name the PDF files.


There are two ways that Win2PDF can name documents based on the document contents.  The first content based naming method can search the text of a document, and then extract a word following the target search word. It requires that document contains text with a common search word that exists in all PDF files.  


The second content based naming method uses the position of the text in the document based on the row (line number), the column (number of characters within the line), and the length of the text field in number of characters.  This method only works for documents or forms with exact formatting for each document.


To see the text searched by Win2PDF for both methods, you can create a sample PDF from your application and use the "extract text" feature of the Win2PDF Desktop Application to see the search text of the PDF.


To enable the first method, the content search word is specified using the Win2PDF Admin Utility using the "Content Based Naming Search Word" field of the "File Name" tab:

Content Based Naming Search Word

Content Based Naming Search Word


After setting the search word in the Win2PDF Admin Utility, you can enable the auto-name feature and specify the content based name using the "User Defined" field and manually typing in the variable name %PDFAutoNameContentSearch%:

Auto-name Content Based Naming

Auto-name Content Based Naming


To enable the second method, the row, column, and field length are specified in any of the standard registry locations using the DWORD registry settings PDFAutoNameContentRow, PDFAutoNameContentCol, and PDFAutoNameContentLength.  The resulting text field from the document is copied to a variable named %PDFAutoNameContentPosition% that can be specified in the "User Defined" field.


The %PDFAutoNameContentSearch% and %PDFAutoNameContentPosition% variables can be combined with any of the other user defined variables to add a date and/or time stamp.


As an example, consider a document that contains the following text:



                                     6600 West 3th St, Ste 116

                                     Owatonna, MN 98901

 Doc #: 398277

                                       Affidavit Of Return


 Paper #: 194094                To: STATE OF MINNESOTA


If we want to name the PDF based on the "Paper #:" field in the PDF, we would use the Win2PDF Admin Utility to set the "Content Based Naming Search Word" to "Paper #:".  After that, we would enable the Auto-name feature, check the "User Defined" option, and set it to %PDFAutoNameContentSearch%.pdf. When the document is printed to the Win2PDF printer, the content based naming feature automatically names the PDF "194094.pdf" based on the contents of the document.


If you print a document that does not contain the search word when the content based naming is enabled, the PDF file is named with "%PDFAutoNameContentSearch%" in the file name.


Content based file naming cannot be used when PDF encryption is enabled.