HTML to PDF command line option now available in Win2PDF

Win2PDF.com has offered a free online HTML to PDF converter for some time, but it has limitations. It only works with public web pages, not private pages on an intranet or local HTML files. It also can’t be automated.

If you try our latest free update — Win2PDF 10.0.114 — there’s a new feature to the Win2DPF Desktop App’s command line optionsHTML to PDF. With this option, you can convert a local HTML file or a web URL directly to a PDF file.

From a Command Prompt window, just issue the command:

win2pdfd.exe html2pdf "sourcehtml" "destpdf"

The “sourcehtml” can be a specific local HTML file or a web URL. If the file name or path contains spaces, make sure to include double quotes (“”) around the complete source file name or URL. The URL can be specified as “https://www.example.com” or “www.example.com”.

Using this option from the command line allows users to automate batch conversion of HTML files to PDF using custom scripts or Microsoft Power Automate Desktop flows. Combined with other Win2PDF command line features, developers can build powerful automated solutions based on HTML reports.

Digital Signatures, Digital Certificates, and PDF Authentication

For centuries people used a wax seal on letters to prove to the recipient that the letter was from a trusted source and had not been tampered with.  Did you know there is a way to do this digitally with your PDF file?

We recently added a feature that allows you to apply a digital certificate to a PDF file when it is created by Win2PDF. The certificate — which can be created by you, or purchased from a certificate authority — allows the recipient to verify that the file was ‘signed’ from the sender and that it hasn’t been altered or modified.

Before we get into the specifics of this feature, we should probably do a little explanation of terms surrounding digital signatures and what is commonly known as “digitally signing” documents, because it can be a confusing topic.

There are several ways of doing this that largely break down into 2 categories.

  1. Electronic Signatures (or e-signatures):  This method of signing a PDF allows the user to apply a simple image representing a person’s handwritten signature.  It is simple and easy to implement, and is legally permissible for many types of documents, but also not very sophisticated.  For example, it would be easy for someone to scan a signature of someone else, and then use it to apply to PDF files without the signature owner ever even knowing about it.  Aside from the representation of the signature, there isn’t a formal way of authenticating the creator is who they say they are.
  1. Digital Signatures: This method of signing is more sophisticated and preferred by companies that require a greater level of source authentication.  With this type of digital signature, an encrypted certificate is embedded within the PDF file.  The recipient of the file can view the certificate and verify exactly “who” created it.  For example, if I create a trusted certificate as John Doe from Win2PDF Sales and applied it to a PDF file, the receiver of that file would be able to verify that “John Doe” really was the creator of the file and that the document hasn’t been modified since it was signed.  There are also different types of certificates that can be used, from simple digital IDs that you can create yourself in Adobe Reader, to more advanced ones that can be purchased and verified by an approved certificate authority (CA).

The new Win2PDF feature utilizes this second method — digital signature, or digitally signing documents using certificates.  It requires a valid Win2PDF Pro software license (request a trial version if you want to try this), and it assumes that you have already either created or obtained your own digital certificate.  Adobe’s web site provides documentation on how to create your own Digital ID in Adobe Reader.

Here is an overview of the steps needed to apply a digital certificate to a PDF file using Win2PDF:


  1. Download and install Win2PDF Pro 10.0.108 or later software. [Note: This links to the Win2PDF Pro Service Pack for the latest version.]
  1. Download and install the PDFSignWithCertificate Plug-In.
  1. Once these 2 components are installed, you will see a new checkbox on the Win2PDF file save window.  If this box is checked, you will get a pop-up to select a certificate when the PDF file is saved.

  1. When the PDF file is saved, choose your Digital Certificate.  If you used Adobe Reader to create your digital ID certificate, for example, the file would have a .pfx file extension and be located on your hard drive folder named:

C:\Users\[your username]\AppData\Roaming\Adobe\Acrobat\DC\Security


  1. When the Digital Signature file is applied, it will require you to enter in a password to complete the certificate application to the PDF file.  This password is something you set up when creating your Digital ID or obtained from a certificate authority.

  1. Lastly, when you open the PDF file in Adobe Reader, Adobe recognizes the PDF file as being signed with a valid digital certificate.  You can see how this is displayed in Adobe below.
  1. If you examine the certificate in the Adobe Reader software, it will show the details that were used. Here, the recipient could verify that the file was signed by John Doe from Win2PDF Sales. 


For advanced users, Win2PDF Pro also supports a command line to sign PDF files with a digital certificate.

This has just been an overview of the new Digital Signature feature in Win2PDF Pro.  If you have any questions please let us know and we’ll be glad to provide more assistance.

Video demonstrates PDF renaming using Win2PDF and Power Automate Desktop

As we continue to document Win2PDF and Microsoft Power Automate Desktop, we now have a short video tutorial that shows how to rename a folder of PDFs based on content found in each PDF file.

How to rename PDFs based on file contents

Give it a look. This may make it easier to get a basic understanding of how these two tools work together, and how you can take advantage of other automated PDF workflows.

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.