Flattening a PDF file with Win2PDF

We recently stumbled across this article outlining a problem with 2020 tax returns saved as a PDF file.


Q: I’ve been using the free Adobe Acrobat Reader DC to fill-in and save PDF tax forms on my PC. But when I recently called up a stored tax form, the data I’d filled-in appeared for a moment, then disappeared, leaving just a blank tax form. I then called up other tax forms that I’d saved earlier, and found that they still had their data. I then tried using another PC, and found that some stored tax forms contained the data I’d entered, while others had gone blank. Adobe won’t help me with this problem because I’m using a free app. What’s wrong and what can I do?


In this case, there was a glitch in the PDF viewer where the filled-in data appeared to “go missing”, even though the information was saved in the file. This type of problem is caused by PDF layers, and it can be easily fixed by flattening the PDF file.

Basically, flattening the PDF means compressing all of the data onto a single layer. No data or information will appear to be missing — all of it will be visible at all times — so the problem experienced with the “missing data” in the tax forms will be eliminated.

While there are several ways to flatten a PDF file, one of the easiest is to just print the document from Adobe Reader (or any PDF viewer) to the Win2PDF printer using the PDF Image Only option. That will flatten it automatically.

After you print to Win2PDF, the resulting PDF will no longer be searchable. If you want the text in the flattened PDF to be searchable, you can download and install the “Win2PDF Desktop with OCR” add-on and select “Portable Document Format – Searchable” as the Win2PDF “Save As Type”.

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 10 build 98 Update Now Available

The time honored tradition continues! Punxsutawney Phil saw his shadow, which means 6 more weeks of winter AND new Win2PDF 10 features to help you get through it!

The latest update to Win2PDF 10 (build 98) is now available on the official Win2PDF download page.

Some of the new features have been documented in previous blog posts, but now those features (and some others) have all been collected into a single update. This Win2PDF 10 (build 98) software is a free update to licensed Win2PDF 10 users.

The biggest changes are related to enhanced mail support for sending PDF documents, new command line options for converting and manipulating image and PDF files, and general bug fixes and stability improvements. Here’s a summary of the changes.


  • Added IMAGEPDF command line to convert a PDF file to a PDF Image Only (color or monochrome).
  • Added support for page range in PDF2TIFF command line.
  • Added a Send Mail feature to the Win2PDF Desktop App.
  • Added support for the PAGECOUNT command line option to return the number of pages in a PDF.

All of these features were added to the Win2PDF software based on customer feedback and feature requests.

Is there something you’d like to see in a future version of Win2PDF? If so, let us know. We’ve got another 6 weeks of winter to work through.

How the Lowly PDF Played the Longest Game in Tech

Here’s an interesting article on why PDF has been the de facto digital document format for almost 30 years (with Win2PDF being available for more than 20 years of that time). One secret to the format’s success: “You only think about it when it doesn’t work. And happily, for PDFs, that’s quite rare.”

As the article notes, “the real key to the dominance of the PDF has less to do with its future than with its roots. From the start, it was meant to be lightweight and forward compatible, meaning the format would continue to be readable well into the future.” Even documents created with PDF version 1.0 continue to be readable today with the existing PDF readers.

So, hats off to the lowly PDF. It rarely garners the respect it should.

Enhanced Mail Support in Latest Win2PDF 10 Update

Win2PDF has always had the capability to attach a new PDF file to a mail message, though the implementation was limited to the default MAPI mail client on the computer (typically Outlook).

Many users have asked us to support other mail programs and services, like Gmail or Yahoo! Mail, to send files. Our latest 10.0.93 version of Win2PDF dramatically improves mail client support and allows for direct mail integrations with:

These mail programs can be set up using the new Configure Win2PDF Mail window, which can be accessed either from the Win2PDF Start menu program group (shown below):

[You can also use the Windows search box (the “magnifying glass” icon) and search for Configure Win2PDF Mail to open the configuration screen.]

Or, it can be accessed directly from the Win2PDF Desktop program, by going to File → Mail → Configure Mail (shown below):

Once the Configure Mail window is accessed you will have the following options to enter your mail settings:

To fill in the different mail settings, please see the individual support pages for Microsoft Outlook, Thunderbird, Gmail, Outlook.com, Yahoo! Mail, or Custom SMTP Server.

After the mail program settings have been configured, you can send a PDF file using one of these two methods:

  1. Select the Send file… option on the Win2PDF file save window (if you are creating a new PDF file with Win2PDF), or
  1. Open a PDF file in the Win2PDF Desktop app and choose File → Mail → Send Mail (if you are just sending an existing PDF file)

And that’s it. You can download the latest 10.0.93 software (a free update for existing Win2PDF 10 users) from our Win2PDF 10 Update page.

As always, if you have any questions, just send a mail to [email protected].

[Case Study] Converting TIFF to PDF Using New Command Line Tools

Win2PDF has expanded its Command Line Interface to support two new conversion features.

  1. TIFF to PDF — This option converts TIFF graphic images into PDF files.
  1. PDF Image Only — This option converts PDF files to an Image Only format. Image Only PDF files can be used to make the PDF unsearchable, “flatten” text fields for security, speed up loading time for complex PDFs, and reduce the PDF file size.

As an example, consider this example we recently solved for a customer. They wanted to merge a scanned TIFF image to an existing text-based PDF file.

To accomplish this, they created a small batch file. The first line of the batch file converted the TIFF file to a PDF.

Win2Pdfd.exe tiff2pdf "1.tif" "1.pdf"

The 2nd line merged the PDF into the existing text PDF. (where “2.pdf” was an existing searchable text-based PDF).

Win2Pdfd.exe append "1.pdf" "2.pdf" "New.pdf"

The 3rd line flattened the file to an Image Only PDF. This made the combined PDF file unsearchable.

Win2Pdfd.exe imagepdf "New.pdf" "NewImageOnly.pdf" mono

In terms of formatting for the batch file, full path names were used so that it looked like this when the batch file is run from the Windows command prompt:

They had been struggling to find a solution to do this one particular document conversion, and the batch file solution not only provided the final document with the formatting they needed, but also provided the flexibility to integrate this into their existing document management process.

As we expand the options available in the Win2PDF Command Line Interface, the ability to do these types of highly customized and automated solutions is becoming easier, especially when coupled with Win2PDF Plug-Ins.

As always, if you have a particular conversion or process need for your PDF files, let us know if we can help.

Win2PDF as a Replacement for Google Chrome’s Discontinued “Save To Google Drive” Feature

Google’s Chrome web browser currently has a feature called “Save to Google Drive”. It appears in the printer list when printing from Chrome, and allows the user to print and save a web page directly to the user’s Google Drive account (and store as a PDF).

This feature will be going away on December 31, 2020, as Google deprecates its Google Cloud Print feature.

Fortunately, you can easily replace this feature using Win2PDF.  Just follow these steps.

 1)  Install the free Google Drive for Desktop application on your computer. This will create a folder on your computer that will be synced with your cloud-based Google Drive account. On your PC, you will see a new folder named “Google Drive”.

2)  Print from the Chrome browser and select “Win2PDF” as the printer.

3)  Save the PDF file to the “Google Drive Folder”.

4)  [Optional] Select “Save as type:” to be “Portable Document Format – Searchable (OCR PDF)”. With this option selected, not only will the PDF file be saved to your Google Drive account, but it will also be converted to a searchable PDF file. Normally, printing from Google Chrome creates an Image-only PDF file, but this option will produce a searchable PDF file with selectable text. [Note: You’ll need to download the optional Win2PDF Desktop with OCR Download to access this save as option.]

Once the file has been saved to your Google Drive folder, it will be synced with your cloud-based Google Drive account and be accessible anywhere.

As a side note, I’ve used this feature frequently as a quick way to save recipes that I find online. If I want to save them, I just go to Print -> Save to Google Drive and then pop them into my recipes folder for future reference. Because they are a PDF file stored in the cloud, I can access them from my iPhone if I am shopping at the store, or on my iPad if cooking in the kitchen.

Now I can still do that and best of all, the Win2PDF solution is actually better because of the ability to create searchable recipes!

Bon appetit!

Win2PDF Plug-Ins Extend Features Specific to Customers’ Needs

Last month we introduced a new Win2PDF Plug-In for Slack, and this month we’re back with several new Win2PDF Plug-Ins.

A Win2PDF Plug-In is simply a small customizable program that can be created, modified, or installed that will give the user an option to automatically take some action with the PDF file after it has been created. It allows Win2PDF’s functionality to be extended to address specific customer needs or workflow integrations. For example, it has already been used by customers to upload PDF files to a content management system, automatically make archival copies of PDFs, store PDF in cloud-based services, delete blank pages, split PDF files into single page documents, use multiple watermarks, and send a PDF file to a specific email program.

Why use Plug-Ins? Why not just add these features directly to Win2PDF?

The Win2PDF Plug-Ins were created specifically to add capabilities that might be unique to each customer. Most of the new Plug-Ins were unique or very specific to a customer request, so they may not be useful to the user base at large. Rather than clutter the main Win2PDF program with these types of unique features, we allow them to be created, customized and added as needed for each customer.

As of today, there are 8 additional Plug-Ins available for download at our GitHub page. [GitHub is a central code repository for our Plug-In samples — you can download compiled Plug-Ins that are ready to use, or, if you are a developer, you can download and modify the source code to build your own Plug-Ins specific to your needs. These examples show what can be done with Win2PDF, and provide a template for future solutions.]

The new Plug-Ins are:

  • PDF Send To Outlook – Add a “Send To Outlook” option to Win2PDF File Save window to automatically attach a PDF to an Outlook email message.
  • PDF Duplicate File – Automatically make a duplicate copy of the newly created PDF file in a designated duplicate file folder which may reside on a shared network location or in a cloud based folder (OneDrive, DropBox, Google Drive).
  • PDF Print Logger – Automatically log files created by Win2PDF to the Windows Event Log.
  • PDF Archive File – Automatically archive newly created PDF files created by Win2PDF in a designated archive file folder which may reside on a shared network location or in a cloud based folder (OneDrive, DropBox, Google Drive). Files are appended to an archive PDF named based on the current date.
  • PDF Delete Pages – Automatically deletes extra pages from a newly created PDF.
  • PDF Split Pages – Automatically splits a multi-page PDF into separate one page PDFs.
  • PDF Apply Multiple Watermarks – Automatically apply different watermarks to separate sections of a PDF [Requires Win2PDF Pro].
  • PDF Image Only Flattener – Automatically merge watermark layers into a single layer Image Only PDF [Requires Win2PDF Pro].

A few other notes:

  • The samples only allow one Win2PDF Plug-In used for each instance of the Win2PDF printer.
  • If you wish to remove a particular Win2PDF Plug-In, you can use the Windows Add/Remove Programs feature to uninstall.
  • All of the Win2PDF Plug-Ins hosted on this page can be used at no charge. Some only work with licensed versions of Win2PDF. Contact [email protected] for a 30 day evaluation license.
  • An evaluation version of Win2PDF can be downloaded for free at https://www.win2pdf.com/download/

If you have any requests for Plug-Ins, let us know. We’re interested in building out this capability with more examples, so if you have a particular integration or special need, send an email to [email protected] and tell us about your requirements. If it’s something we can assist with, we’ll be happy to help.

For now, hop over to the Win2PDF Plug-Ins page and take a look.

It’s Greek To Me: Case Study for PDF Image Only Files

We recently received a unique support question that illustrated a real-world case where the PDF Image Only file save option saved the day. Here was the issue our customer came to us with:

I am trying to help my wife who is teaching ancient Greek language classes online. The problem is that there is no standard universally recognized font for ancient Greek – they all render the language in different ways. And ancient Greek is quite different from modern Greek. She can create documents on her Windows PC using one of a number of specialized TrueType (TTF) fonts. And she can convert documents to Unicode for pasting into web content and/or she can print or export Unicode documents to PDFs. For most of her students these processes are successful. However some students see only gibberish. She has no control over the various platforms her students are using, Windows, Mac OS, iOS, Android, Chrome, etc.

By Hesiod / Houghton Library, Public domain, via Wikimedia Commons

Is there a way Win2PDF can handle this situation? The best option would be if she could print/export her multi-page documents to non-searchable, graphics only PDFs.

For this case, the solution was easy. Win2PDF can create multi-page image only PDFs that render the TTF fonts as graphics. It’s just a standard Win2PDF file save type the user can select when printing.

While this particular customer was able to make the conversions using other programs, this was the easiest method since it was just a single step to save the PDF file.

When we recommended this solution to the customer, he gave us the following reply:

While the Covid-19 pandemic lasts and much teaching is being done online, you might want to share this information with university departments of Classics and Religious Studies and theological colleges (and other academic institutions that teach archaic languages for which there are no universally standard means of rendering them as computer-created text). My wife cannot be the only university instructor with this problem.

Consider it done.