A desktop publishing application from Microsoft that focuses on page layout and graphic design.
The easiest supported way to batch-convert a large number of .pub files is to use the provided PowerShell automation script together with an installed, licensed copy of Microsoft Publisher.
Steps:
- Ensure Publisher is installed
- Install and activate a working, licensed version of Microsoft Publisher on the machine that will run the conversion.
- Download the sample PowerShell script
- Download the sample script
Convert-PubFileToPDF.ps1from the article “Microsoft Publisher will no longer be supported after October 2026” (see reference below under Example conversion script).
- Download the sample script
- Adjust the script if needed
- Open the script in a text editor (such as Visual Studio Code or Notepad).
- Optionally modify output folder, file naming, or export options as needed. The script uses Publisher’s
Document.ExportAsFixedFormatAPI; you can adjust parameters such asPbFixedFormatTypeandPbFixedFormatIntent, or switch toDocument.SaveAswithPbFileFormatif you want other formats.
- Open PowerShell with appropriate execution policy
- Open Windows PowerShell as an administrator.
- Ensure execution policies allow running local scripts (see the execution policies link in the same article for details). Adjust only as needed and according to your organization’s security policies.
- Run bulk conversions
- Place
Convert-PubFileToPDF.ps1in a folder that’s easy to access. - Use one of these examples (replace paths with your own):
- Convert a single file:
.\Convert-PubFileToPDF.ps1 -Filter "C:\\Documents\\MyFile.pub" - Convert all .pub files in the current folder:
.\Convert-PubFileToPDF.ps1 -Filter "*.pub" - Convert all .pub files in the current folder and subfolders:
.\Convert-PubFileToPDF.ps1 -Filter "*.pub" -Recurse - Convert all .pub files in a specific folder:
.\Convert-PubFileToPDF.ps1 -Filter "C:\\Documents\\*.pub" - Convert all .pub files in a specific folder and its subfolders:
.\Convert-PubFileToPDF.ps1 -Filter "C:\\Documents\\*.pub" -Recurse
- Place
- Notes and behavior
- The script is designed to continue running even if some files fail and will report which files succeeded and which encountered errors.
- If a PDF with the same name already exists in the target location, that file will not be overwritten; an error will be shown. Rename or remove the conflicting file and rerun the script if needed.
This approach lets thousands of Publisher files be converted in bulk without opening each one manually.
References:
- Microsoft Publisher will no longer be supported after October 2026
- Save As or convert a publication to .pdf or .xps using Publisher
- I have thousands of Publisher files; I'm not opening each one individually to convert them. What is this BS about retiring publisher and losing access to all those files? This is 20 years of work that my business is going to lose, we won't recover from th - Microsoft Q&A