How to automatically name and send PDF files by email

Here is a more advanced example of using our new content-based naming feature in Win2PDF.

Suppose you want to name a PDF file based on some value within the PDF file, and then email the PDF file to an email address that also resides within the PDF file. This could be useful if a customer wanted to send out invoices to customers based on an email field in the invoice, or to send a report unique to an individual client based on their specific information.

The latest version of Win2PDF 10.0.71 includes new features that allows you to search for up to three different values within the PDF file, and then use those values for Auto-naming and for sending the email.

Let’s show this feature using the following example: Here is a sample invoice from an ERP system. It includes both an invoice number (which we’ll use for the naming of the PDF file) and it contains an email address for each invoice (which we’ll use for addressing the email).

We’ll start by opening the sample file of the invoice in the Win2PDF Desktop app. Once opened, you can use the Auto-Name ➜ Define Auto-Name Search Field menu to define up to 3 search fields.

We’ll define two of the search words as follows:

“Search Field 1” = “Invoice #:”
“Search Field 2” = “CUSTOMER EMAIL:”

When you select the Define Auto-Name Search Field, you’ll get a window where you can enter the text you wish to search for (see image below). The value immediately following this search field will be used in the configuration screen.

After you have defined the search fields, Win2PDF will display the values of the search in the current document as a confirmation.

Using our sample document as a reference, the values (the text immediately following) for the search fields are:

“Search Field 1” value = “01357”
“Search Field 2” value = “[email protected]

These values can and likely will change for each document being printed.

Next, when you go to the Auto-Name ➜ Configure Auto-Name… menu, these two search fields will the be used for the file name, and for the email recipient.

Now when you print an invoice to Win2PDF from the ERP system, the files will be automatically named and attached to a new email message as shown below.

You could take this one step further and set up these PDF files to be sent automatically using our Win2PDF Mail Helper add-on application.

There are many options available for naming and emailing PDF files automatically — more than we can reasonably cover in this post. So, if this does sound useful and you need help configuring this for your own reporting applications, let us know and we’d be happy to assist you setting this up for your needs.

Win2PDF Report Server for Legacy Reporting Applications

We’ve recently added new capabilities to our Win2PDF Terminal Server Edition (TSE) software that allows it to be used with legacy applications that were originally designed to create paper reports.

What do we mean by legacy reporting applications? In this context, what we are referring to is a class of (typically) older software programs that sent text or special printing data directly to a dedicated paper printer. Essentially, these reporting applications would stream the data directly to a laser printer connected to the local area network, and the paper printer would print whatever information was sent.

“Now more than ever, with employees working remotely or from home, it’s important for companies to adapt their interfaces to legacy programs so that the reports can be captured and shared electronically as PDF files.”

The new Win2PDF Report Server component of Win2PDF TSE does the following:

  1. Creates a dedicated copy of the Win2PDF printer named Win2PDF Report Server
  2. Installs a Windows AppSocket Service that uses the AppSocket printing protocol, also known as Port 9100, JetDirect, or RAW printing mode. The service accepts print data from a legacy application and then routes it to the Win2PDF Report Server application installed on the server*.
  3. Installs a console monitor program called the Win2PDF Report Server. This program is added to the startup folder and takes data routed from the Win2PDF Appsocket Server and converts it to PDF using the Win2PDF Report Server printer.

* Note: The Win2PDF Report Server has the capability to support additional printing protocols based on need. If you have an application that relies on a protocol other than AppSocket, let us know and we can provide more information.

The Win2PDF Report Server currently accepts data in text or Printer Control Language (PCL) format, and the created PDF can be named and saved on the customer’s network using any of the numerous Win2PDF Auto-name options.

If you have a need for this type of PDF reporting solution for legacy applications, contact [email protected] for more details.

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.

Using Auto-name to Save Reports to PDF

As the Coronavirus problem persists and more and more employees work from home, we’re getting questions from customers who are trying to adapt reporting applications to generate PDFs. Specifically, they are looking at ways of automatically saving these PDF reports without any user intervention.

The easiest way to do this is to enable our Auto-name Files feature. It can be found by clicking on the PDF Options… button on the main Win2PDF file save window as shown below.

Here are a few tips on using the Auto-name Files feature:

  • There are a variety of predefined options to use which allow you to include the document title, date, and time in the naming of the file. However, there is also a User Defined option which gives you much more flexibility. You can use any number of variables to make a customized file name based on document titles, as well as the time and date.
  • Not only can you use these User Defined variables to customize the file name, but you can also customize the folder(s) you are trying to save to. For example, if you used the following variables as the User Defined name:
%PDFYear%\%PDFMonth%\SalesReport-%PDFMonth%-%PDFDay%-%PDFYear%.pdf

You’d end up with the following results whenever you saved the PDF file.

[Default Save-to folder] \ [Current year] \ [Current Month] \ SalesReport-MM-DD-YYYY.pdf

In other words, folders will automatically be created (if they are not already present) for the year and month, and the appropriate sales report for the day will be placed in each location.

  • You can also create multiple Win2PDF printers and set auto-name for specific departments/people. For example, suppose you want to keep the normal Win2PDF printer for use with day-to-day PDF creation, but you want to make a copy named “Reports from Win2PDF” that will be used to generate PDF files from a specific application (without any user interaction). You’d simply need to
    1. Add a copy of the Win2PDF Printer and name it “ Reports to Win2PDF”
    2. Turn on the Auto-name feature (as discussed earlier in this post) for this new copy of Win2PDF
    3. You can repeat steps 1-2 to create any number of specialized Win2PDF printers that save PDF files automatically, with names and locations defined by an application, department, location, etc.
  • You can also apply Auto-Name settings to all users. To do this:
    1. Configure Auto-Name in PDF Options…
    2. Open the Win2PDF Admin Utility. The file name definition shows up on the File Name tab.

    1. Check Apply to all users
    2. Click Apply, and Auto-Name will apply to all users

The Auto-name feature is very powerful.  If you have reports you want generated on a regular basis, and you want to define your file names and eliminate any input from the user, use these tips and let us know if you have any questions.

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.

Win2PDF & Google Cloud Print

Another new feature in our latest Win2PDF 10.0.56 release is the ability to print to a Google Cloud Printer when you save a PDF file. If you’re not familiar with Google’s Cloud Printer, you can visit the Cloud Print product page for more information.

If you check the “Print file” option on the main Win2PDF file save window (shown below), and if you have Goggle Chrome installed, you’ll be notified that Google Cloud Print can be used.

cloudprint1

If you select “Yes” to “Use Google Cloud Print”, Win2PDF launches Chrome after the PDF (or other format) is created.

cloudprint_printersThe user can select a cloud printer, and the print job will be submitted to the cloud print queue. The Chrome printer selection also contains a “Save to Google Drive” option. This can be used to save the PDF directly to the cloud even if Google Drive is not installed on the PC.

If you select “No” to “Use Google Cloud Print”, Win2PDF will present you with list of local printers you can choose from, just as it has with earlier versions of Win2PDF.

While Google has a free “Google Cloud Printer” windows printer driver, it doesn’t allow saving to PDF or combining with other workflow options. Also, the “Google Cloud Printer” doesn’t support Windows Terminal Services, so Win2PDF Terminal Server Edition (TSE) may be the only option to print from an Windows native app to a Google Cloud Printer from a Citrix or Microsoft terminal server.

If you use Google Cloud Printers in your organization or home, this new feature gives you a great way to save a PDF and print in a single step.

Win2PDF 10.0.56 is available as a free update to registered Win2PDF 10 users.

Change the default file name when saving PDF files

The Win2PDF Auto-name feature makes it easy to customize the file name and automatically save a PDF without prompting, but what if you want the File Save window to appear so you can email, print, or manually change the file name?

We just released Win2PDF 10.0.56 (available as a free update to Win2PDF 10 users), and one of the new features is the ability to customize the default file name that is used to save PDF files in the Win2PDF File Save window. For example, in previous releases if you had a Word file named “Sales Report.docx” and you went to print it as a PDF file, the default name in the Win2PDF File Save window would be named “Sales Report.pdf”. You could always change this name, but there wasn’t a way to customize this name when you first entered the file save window.

This is now customizable. If go to the Document tab after clicking on the PDF Options… button, you see some new options.

NewSaveAsOptions

When the the Auto-name Files option is unchecked, the settings in this window apply to the name displayed in the Win2PDF File Save window. You can add a fixed file name start, a date stamp, or a timestamp. Advanced users can customize the order of these items using the user defined setting.

In the screen shot example listed above, the month-day-year was added to the default “Sales Report” file name. While this option is set, the date stamp will be applied to all file names when you print to Win2PDF. You can automate your PDF workflow by creating multiple Win2PDF printers, each with different customized default file names.

The customizable PDF file name feature can save time by eliminating the need to manually type date or time information to the file name.

Download the new Win2PDF 10.0.56 software at the download page of our web site.