Name or Rename PDF Files Based on Content Below a Search Term

In previous blog posts [see 1, 2], we showed how Win2PDF can name (or rename) PDF files based on data contained within a file. This feature has been especially useful for users needing to manipulate invoices, as this twitter user has noted:

Brainsweat. Lots of it. We’ve been talking with a lot of users that are spending a lot of time trying to sort through massive numbers of PDF invoices and renaming them based on content, attaching them to emails, splitting them apart, etc.

We now have a free update (Win2PDF 10.0.141) that expands on the capability to make this happen. Namely, it adds the capability to capture the search field below a search term. Previously it only allowed you to select text that followed after a search term. As many of you may know, it’s not uncommon for the invoice number to reside on a different line, so now both types of searches are possible, as shown below:

To use this feature, you’ll first need to open a sample PDF document in the Win2PDF Desktop App to define the Auto-Name Search Field.

Then, based on the example file shown above, you’d enter in the Content Search Word of “Invoice #”, choose the search direction to be “Search Below”, and it will show you what the found search field is:

After you have defined this search field, you can do a few things.

One, you can use this term to rename a batch of PDF files if they already exist. You simply need to select the Auto-Rename menu option from the Win2PDF Desktop App, and then choose your Auto-Name variables including the “Search Field 1” text as shown below.

Two, instead of renaming existing PDF files, you can set your current printing method to use this Auto-Name method for new PDF files. You’ll just need to go to the Configure Win2PDF Auto-Name Settings page to set up how you’d like the PDF files to be named.

And three, you can use this feature via the command line interface for more advanced users. Previously we used the command line command “getcontentsearch” to find search text that immediately follows the search word. Now we’ve added the “getcontentsearchbelow” command, which finds the search text that is directly below the search word.

Hopefully, this is one additional feature to reduce the amount of brainsweat required for managing your invoices.

Win2PDF Release 10.0.72 Now Available

A new version of Win2PDF (a free update to existing Win2PDF 7 or Win2PDF 10 users) is available now at the Win2PDF download page. In addition to bug fixes and stability improvements, it adds several new features to Auto-Naming PDF files, command-line options, and the Win2PDF Desktop App. Win2PDF 10.0.72 includes the following new features:

  • Adds a Configure Win2PDF Auto-Name shortcut to the start menu to make configuring the Auto-name features easier.

  • Adds Send File and Print File actions to the Configure Win2PDF Auto-Name menu to automatically email or print a PDF. See How to Automatically name and send PDF files by email for an example of automatically naming and sending invoices to email recipients based on the contents of the PDF.

  • Performance and stability improvements

Again, if you have a license for Win2PDF 7 or Win2PDF 10, you can download this new version at no charge.

Content-Based File Naming with Win2PDF

One new capability of the Win2PDF Auto-name feature is the ability to define and save PDF files based on defined content that resides “within” the document to be printed.

For example, suppose you have a reporting application that spits out a report, and you want to name this report based on the document number, or invoice number, or customer name, or some other value that exists inside of the report.

There are a couple of different ways to set the Content-Based File Naming within Win2PDF.

The first method is to use a search word.  Using this option, you would define a word to search for in the document (like document # or invoice # or customer name), and then the software would use the following word or set of characters to be used in the file name of the PDF file.

The second method is to use a defined content field.  Using this option, you would define a particular fixed location on the page where the content field always exists, and this would be used in the file name of the PDF file.  The following animation shows the basic process, but more detailed instructions can be found at the content field section of our online user guide.

Content based naming 1

How would you know which method to use?  Well, the search word option works when you know the content field value always follows a particular word, but the exact position on the page or length of this value may be variable.  The content field option works when the content field value always exists at the exact same location on the page.

Grabbing the name from a printed purchase order may use the search word option, since the length of the purchase order number may change from customer to customer.  On the other hand, grabbing a Tax ID number from an IRS form may use the content field option, since the number and location on the form will always be fixed.

As more customers are working to digitize their reporting functions (without any user interaction), we feel like this content-based file naming will become an increasingly popular tool for automating reports.

Content-based File Naming with Win2PDF

*** NEW FEATURE ALERT ***

In our latest Win2PDF 10.0.58 update we added a new feature for content-based file naming. It allows a PDF file to be named based on a certain word or set of characters that reside inside of the document being printed.

Here is the customer situation that prompted the new feature:

A county sheriff’s department wanted to generate PDF files from a legacy AS/400 application. A secretary named the PDF files based on a document number that was listed in the original document, and because she did so manually it was time-consuming and error-prone.

An example transport order from the sheriff’s department looked like this:

sheriff1

With the content-based file naming feature in Win2PDF, however, this process is automated. It allows Win2PDF to search the text of a document being printed, find a target search word, and use the following word as the PDF file name. It requires that PDF files contain text with a common search word that exists in all PDF files. (*Note: The “word” can be numbers or any character string that has a space before and after the “word”).

In the sheriff’s example, the content search word is specified as “DOC #:” in the Win2PDF Admin Utility.

sheriff2

Then, in the Document section of the Win2PDF file save options, the “User Defined” field was enabled with “%PDFAutoNameContentSearch%.pdf” as the file name.

win2pdf-auto-name-content-based-naming

The result? When each file is printed, Win2PDF searches for the document number in the original file, and then automatically names the PDF file with this number. No possibility of manual errors or extra time involved.  In this case, the file was automatically named “118277.pdf” when the file was printed.

Again, this was a relatively simple modification that we were able to do for customer that had a particular need and had no ability to change the original AS/400 program printing the documents.

If you have a similar need, let us know and we may be able to help.