A Win2PDF Step-by-Step Guide: Reformatting File Names with Microsoft PowerRename

What do you do when you need to convert a PDF document into multiple images (1 per page), but with a very specific file name format? Consider this recent customer situation:

The customer had a PDF product manual (i.e., ‘Widget Manual.pdf’) and wanted to convert each page of the manual to a JPG image file. And, each JPG file needed to be named in a format that included its corresponding page number and with a uniform file name length (e.g., “Widget_Page001.jpg”).

While they were able to convert the PDF file to JPG (using the File ➔ Export ➔ JPEG option in Win2PDF Desktop), they weren’t able to control how the resulting file names would be formatted.

Rather than add complexity to the Win2PDF Desktop interface, we suggested using the free Microsoft PowerRename utility.

You can use this same methodology for other situations as well, so we can generalize the procedure. Here’s how:

Step 1) Download and install Microsoft PowerToys.

The easiest way is to just search for this app in the Microsoft Store and click Install.

Make sure you have the latest version of PowerToys installed, as older versions may not support regular expressions which will be necessary in our example.

Step 2) Save the multi page PDF file to a series of JPG files

The easiest way to convert the PDF to JPG is to use the Win2PDF Desktop Export feature, as shown here:

When exporting, the base file name defaults to the name of the PDF file, which can be changed if needed.

Upon file Save, multiple JPG files are created.

Win2PDF Desktop creates one JPG file for each page in the PDF and names them with the base name of the PDF file and increments of 1 (with preceding/following ‘.’characters). So, this is what you get:

Widget Manual.pdf ➔ Widget Manual.1.jpg, Widget Manual.2.jpg, Widget Manual.3.jpg, …

What you need, however, is to have it look like this:

Widget Manual.pdf ➔ Widget_Page001.jpg, Widget_Page002.jpg, Widget_Page003.jpg, …

Step 3) Select the JPG files and open PowerRename

After the files have been converted to JPG, you can select all of them in Windows explorer and right-click to choose PowerRename.

Step 4) Search and replace text using a regular expression

This step shows how regular expressions can be used to augment the file name. In many cases, a simple “search and replace” will be sufficient. But, since the customer in our example wants each JPG file to be a page number in a specific format (3 digits long padded with zeros), we can use the regular expression shown below to accomplish our goal.

Note: the icon for Enumerate items under Text formatting must be selected.

You’ll see a preview of the file name conversions on the screen, and when it looks correct you can select Apply. And that’s it! If you make a mistake after you’ve applied the rename, you can go back to Windows explorer and select the “” option shown below and choose Undo.

This is obviously a very specific example but it shows how it can be done. We highlighted this example using a regular expression because it is such a powerful and expansive tool that most programmers are familiar with.

If you’re renaming PDF files, the Win2PDF Pro Auto-rename feature is an easier to use solution that also supports renaming based on the content of the PDF.

If you need assistance with renaming files with specific criteria, let us know. Just as in the case of this customer, we can usually help, even if it requires finding a solution from another source.

Batch Convert Outlook Emails to PDF Files Using Win2PDF

We recently had the following question submitted to our Win2PDF support site:

I have a folder of Microsoft Outlook emails that I would like to convert to PDF. I want to convert just the one folder (the emails were filtered and sent to the folder by a rule when they were delivered to me). Is there a way to batch convert all emails? The batch convert tool doesn’t appear to include email messages but maybe I am missing something so I thought I should check. Thanks.

Nick

Great question. The Win2PDF Batch Convert feature doesn’t support Outlook emails directly, but it is possible to configure the Win2PDF Auto-name feature to make it easy to convert a folder of emails to PDF from Microsoft Outlook.

To do this, open the Configure Win2PDF Auto-name window and you’ll see the following options:

Enable the “Auto-name files” option, and set the folder name where you want the PDF file (or files) to be placed.

If you want all of the emails to be saved to a single PDF, you should set the following options:

  • (check) Include Document Title
  • (check) Include Date
  • (check) Always Append

If you want the emails saved to separate PDF files, you should set the following options:

  • (check) Include Time (to make each file name unique)
  • (uncheck) Always append

Next, you should make Win2PDF the default printer in the Windows Printers and Scanners folder. This is required because the Microsoft Outlook Quick Print feature only prints to the default printer.

And finally, to create PDFs from the emails in your folder, select the emails in Outlook, right click, and select Quick Print.

Voila! The emails will be sent to the Win2PDF printer and will be automatically named with no user interaction.

This can be extremely useful if you want to archive or collect an email thread that is spread across many different messages, or a folder of messages related to a particular topic, person, or project.

If you have a tip like this for using Win2PDF, please let us know.

Win2PDF 10.0.144 is now available

The latest release of Win2PDF (10.0.144) is now available on the Win2PDF Download site.

The biggest additions to this release are specific to the Win2PDF Pro version of the software, which now supports the ability to batch convert standard word processing documents (Microsoft Word, Open Document Text, and Rich Text Format) to PDF.

Here’s a summary of changes in this new version:

This Win2PDF 10 update is a free upgrade for all Win2PDF 7 and Win2PDF 10 users. If you have an existing Win2PDF standard edition license and wish to use any of the new Win2PDF Pro features, you can purchase a Win2PDF Pro Upgrade.

We’ll be posting more specific information on some of these features next week, with more details on changes to the interface and how these new features can be used. In the meantime, if you would like to evaluate one of the new Win2PDF Pro features (PDF watermark, PDF security, batch-convert, auto-rename, or watch folder), contact us for a free 30 day trial of Win2PDF Pro.

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.

New Feature Preview – Win2PDF Auto Rename

Have you ever had this problem: You have a large number of PDF files that aren’t named descriptively, so you’d like to rename them in a batch process. And further, you want to rename the files based on a specific piece of data that is contained within the PDF file, like a customer name or an invoice/document number?

Well, now you can! We’re in the process of rolling out a new feature called Win2PDF Auto-Rename that will address this issue. The updated setup program for this version is currently available on our helpdesk download page.

Please note: For the moment, this preview feature is visible in all Win2PDF versions, but it will only work as a Win2PDF Pro feature. Standard edition users will see this feature in the preview, but will not be able to complete the rename function. If you would like a 30-day Win2PDF Pro Trial license, contact us.

Let’s look at an example. Suppose we have a reporting system that outputs invoice files with names like “file1.pdf”, “file2.pdf”, “file3.pdf”, etc. What we’d like to do is to search through each PDF file and find the invoice number, or the customer name, or some other field of data to use as the file name. Here’s a short screencast that shows how it works:

Win2PDF Auto-Rename Preview

Let’s also walk through this example step-by-step. Suppose our starting folder of files looks something non-informative like this:

In our example, the files are invoices, and what we really want to do is rename each invoice to the Invoice # that is found within each file. To do this, we first right-click on one of the PDF files and choose Open with -> Win2PDF Desktop to load the file in the Win2PDF Desktop App. For the time being, all the files you wish to rename must be located in this same folder.

Next, after the file has been opened in Win2PDF Desktop, we’ll need to define the search field in the PDF file.

When we select Define Auto-Name Search Field, Win2PDF will search for this text (in our case “Invoice “). Then, it will capture the next string of characters (which is the invoice number) to use for our rename operation. After the selection has been made, you’ll see a confirmation window showing the field data that was extracted.

Now that this has been defined, our last step is to go to the Auto-Name -> Auto-Rename screen to change the file name options.

And that’s exactly the output we want. You’ll see there are currently other options available as well, such as using a content field to find the data for the file name. And you can include a variety of user-defined terms as well if you want to include date and/or time stamps as well. More options may be included in future revisions based on user feedback.

When we select the Rename button, it will show us a confirm window and it gives us the opportunity to Undo the changes if we want to make any changes.

For now, this is a working preview of this feature and we’re looking for real-world examples to help us refine the interface and functionality.

Have a scenario we should consider? Let us know!

Using Win2PDF & Microsoft’s Power Automate Desktop to Rename PDFs

Our last post — Get Into Your PDF Flow using Microsoft’s Power Automate Desktop Software — gave an overview of the Power Automate Desktop software and how it can be used to automate repetitive tasks with PDF files.

Over the next series of posts we’ll show some examples of how this can be done in a real-world context using Win2PDF.

First, let’s start off by using an example where we want to automatically rename a bunch of PDF invoices that are stored in a folder. And then suppose we not only want to rename the PDF files, but we want the new file names to be based on some content within the original files, such as the number following the word “INVOICE”.

In the following example (see Microsoft Power Automate for Desktop flow for renaming PDF based on File Contents for details), we’ll search through each PDF in the folder and rename the file based on an invoice number that follows the word “INVOICE”. Here’s what the desktop flow looks like:

Notice how the Win2PDF command line getcontentsearch feature is used. It allows us to search for the word “INVOICE” in the PDF file, and then return the following content (in this case, the INVOICE number) to the standard output. After trimming any extraneous spaces from this invoice number, the PDF file is renamed to be that invoice number.

You can use the graphical user interface to make your own flow, or you can copy the following into a new Power Automate Desktop flow if you want to use this as a starting point for your project:

# This flow searches the contents of PDF files in the selected folder for SearchText, and renames the PDF files based on the text immediately following SearchText.  Change the SearchText variable to the desired search field.  Note : the SearchText field is case sensitive.
SET SearchText TO $'''INVOICE :'''
Display.SelectFolder Description: $'''Select Folder to Rename''' IsTopMost: False SelectedFolder=> SelectedFolder ButtonPressed=> ButtonPressed3
Folder.GetFiles Folder: SelectedFolder FileFilter: $'''*.pdf''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
LOOP FOREACH CurrentItem IN Files
    # Search for %SearchText% field and return following text in CommandOutput using the following Win2PDF command line:
    # C:\Windows\System32\spool\drivers\x64\3\win2pdfd.exe getcontentsearch "%CurrentItem%" "" "%SearchText%"
    System.RunDOSCommand DOSCommandOrApplication: $'''C:\\Windows\\System32\\spool\\drivers\\x64\\3\\win2pdfd.exe getcontentsearch \"%CurrentItem%\" \"\" \"%SearchText%\"''' StandardOutput=> CommandOutput StandardError=> CommandErrorOutput ExitCode=> CommandExitCode
    IF CommandExitCode = 0 THEN
        Text.Trim Text: CommandOutput TrimOption: Text.TrimOption.Both TrimmedText=> TrimmedText
        File.Rename Files: CurrentItem NewName: $'''%SelectedFolder%\\%TrimmedText%''' KeepExtension: True IfFileExists: File.IfExists.Overwrite RenamedFiles=> RenamedFiles
    ELSE
        Display.ShowMessageWithTimeout Title: $'''Win2PDF Renamer''' Message: $'''Could not find \"INVOICE :\" field for file %CurrentItem%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False Timeout: 10 ButtonPressed=> ButtonPressed4
    END
END

This example shows one way to use Win2PDF’s automation features to create a solution unique to your workflow. It also uses features that were added in the latest Win2PDF 10.0.100 update, so make sure you are using the latest Win2PDF 10 Update when trying any of the Power Automate Desktop features.

Can you think of any similar cases that you might use? If so, drop us a line. We’ll have more examples coming soon.

Get Into Your PDF Flow using Microsoft’s Power Automate Desktop Software

Soooo many requests:

“I wish there was an easy way to convert all of these text files to PDF automatically.”

“Why can’t I just save an entire series of web pages as searchable PDF files?”

“How can I consolidate weekly reports from different applications and formats to a single PDF file without spending my whole afternoon doing so?”

These and other questions arrive in our email inbox daily. It seems everybody has some level of repetitive PDF processing that they do and are looking for an easier way to get it done. And since many of these issues are specific to a particular application or to your own business process, it’s not easy to find a one-size-fits-all solution that gives you the type of “push button” solution you really want.

That’s one reason why we’ve been so focused on creating tools like Win2PDF Auto-name, Win2PDF command-line processing, Win2PDF Plug-ins, and Win2PDF mail integrations. All of these features give powerful automation control to the user to eliminate repetitive steps and reduce processing errors.

Now, there’s something that combines all of these Win2PDF “tools” into a single problem-solving toolkit that works with all of your files and other applications. And best yet, it won’t cost you a penny!

Microsoft’s new Power Automate Desktop software is a free download for Windows 10 users that allows you to easily automate any repetitive tasks from your desktop, including the creation or manipulation of PDF files using Win2PDF. Once installed, you just need to create a desktop flow (the series of steps that automate a specific action or task). And no, you don’t need to be a coder to use it. Microsoft has a simple interface that most anyone can use.

It’s quite easy to build your first desktop flow using either pre-built drag-and-drop actions or by recording your own desktop flows to run later. For this latter method, it works similar to macros in Microsoft Office, by recording repetitive actions from your desktop across multiple applications—like your web browser, Microsoft Excel, Microsoft Outlook, Win2PDF, etc.—and then lets you replay the automation whenever needed.

For example, a quick desktop flow to convert all TXT files in a folder to PDF using Win2PDF (using the Win2PDF Auto-name feature) might look something like this:

A very simple recipe like this could save you a lot of time if you are currently working with PDF files regularly and in the same manner.

We’ll be diving into this topic in a bit more detail in future posts, including some more detailed examples where this might be useful. In the meantime, get into the flow and download the Power Automate Desktop software today and look at the Win2PDF Power Automate documentation to see what it can do for you.

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.

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.