How to bulk convert Publisher (.pub) files to PDF
Last updated
There are three ways to bulk convert Publisher files. If Publisher is still installed on a Windows PC, run Microsoft's sample PowerShell script. Without Publisher, use free LibreOffice from the command line (soffice --headless --convert-to pdf). Or upload folders or a ZIP to an online converter that keeps your folder structure and reports on every file.
On this page
- Bulk convert .pub files to PDF with LibreOffice
- Which method fits your situation?
- Before you start: a planning checklist
- Route 1: Microsoft’s PowerShell script (needs Publisher)
- Route 2: LibreOffice from the command line (free)
- Route 3: Our converter (no install, folders kept)
- Related guides
- Frequently asked questions
- Sources
Bulk convert .pub files to PDF with LibreOffice
Time needed: about 1 hour
Copy the archive
Copy the folder of .pub files to a working location and convert the copy, never your only originals.
Install LibreOffice and close it
Install LibreOffice from libreoffice.org. Close every LibreOffice window before running a batch, or give the batch its own profile, because a running copy can take over the job.
Run the conversion command
Run the command for your system from this guide. It walks through every folder and writes a PDF next to each .pub file.
Find the files that didn't convert
Run the check command to list every .pub that has no matching PDF. Retry those, or send them to someone who still has Publisher.
Spot-check the results
Open a sample of PDFs from different years and compare them with printed copies, paying attention to WordArt, continued articles and fonts.
Which method fits your situation?
| Microsoft’s PowerShell script | LibreOffice command line | Our converter | |
|---|---|---|---|
| Needs Publisher installed | Yes, licensed | No | No |
| Runs on | Windows only | Windows, Mac, Linux | Any browser |
| Cost | Free, if you own Publisher | Free | $5 to $59, one time |
| Conversion engine | Publisher itself (most faithful) | libmspub, an open-source importer | libmspub, plus our layout repairs |
| Output | PDF or ODG (PNG gives page 1 only) | PDF, ODG, text-only DOCX, PNG and JPG of every page | |
| Folder structure | Works through subfolders; check where PDFs land | Up to your script | Kept in the download ZIP |
| Per-file report | On-screen list of what converted and what failed | Up to your script | report.csv with pages, warnings and errors |
| Files stay on your network | Yes | Yes | No. Uploaded, then deleted after 24 hours |
| Effort | Medium | Medium to high | Low |
Short version: if someone in the office still has a working copy of Publisher, Microsoft’s script gives the most faithful PDFs. If not, LibreOffice is free but takes some scripting, and our converter uses the same importer, adds layout repairs and needs no setup.
Before you start: a planning checklist
When you need to mass convert an archive, it goes smoothly if you plan it like a records project, not a one-off click. Work through this list first.
- Take an inventory. List every .pub file with its size and date. On Windows, in PowerShell:
On Mac or Linux:Get-ChildItem "D:\Shared" -Recurse -Filter *.pub -ErrorAction SilentlyContinue | Select-Object FullName, Length, LastWriteTime | Export-Csv "$HOME\Desktop\pub-inventory.csv" -NoTypeInformationfind ~/Shared -iname '*.pub' > pub-inventory.txt. Microsoft also suggests searching OneDrive and SharePoint for “.pub” (Microsoft’s FAQ). - Remove files that aren’t Publisher documents. Files like
id_rsa.pubin.sshfolders are login keys, not documents. - Find duplicates. The same bulletin often exists in five places. In PowerShell, this groups identical files:
Convert one copy of each. Don’t delete the others until you’ve decided on a retention policy.Get-ChildItem "D:\Shared" -Recurse -Filter *.pub | Get-FileHash | Group-Object Hash | Where-Object Count -gt 1 | ForEach-Object { $_.Group.Path; "" } - Keep the originals. Convert a copy of the archive, never your only originals. Afterward, store the .pub files read-only next to the PDFs.
- Decide formats and names. PDF for the archive and printing, ODG if you’ll edit in LibreOffice Draw, text-only Word if you’ll reuse the words. Keep the same base name (
2019-04-21 Easter Bulletin.pubbecomes2019-04-21 Easter Bulletin.pdf) so the two are easy to match. - Install your fonts (LibreOffice route). If your office used particular licensed fonts, install them on the converting computer first. Missing fonts are the biggest cause of changed line breaks.
- Run a pilot. Convert 20 to 50 files from different years and staff members. Compare them with printed copies and time the run. Files from the 1990s behave differently from newer ones; see old Publisher files.
- Run the full batch, then verify. Compare the number of .pub files with the number of PDFs, list the missing ones, and open a sample (about 5%, at least 20 files).
- Handle failures. Retry them, then send the stubborn ones to someone with Publisher.
- Write down what you did. A short note in the archive folder (date, tool, settings, known issues) will help whoever comes after you.
Route 1: Microsoft’s PowerShell script (needs Publisher)
Microsoft’s Publisher retirement FAQ links to a sample script called Convert-PubFileToPDF.ps1. It drives your installed copy of Publisher to export each file as PDF. Microsoft calls it a sample to adapt and test for your own needs.
Requirements (Microsoft Q&A):
- a Windows PC with a working, licensed copy of Publisher. Microsoft 365 copies were removed from October 1, 2026, so in practice that means Publisher 2016, 2019 or 2021
- the script, downloaded from the link in Microsoft’s FAQ
- PowerShell with an execution policy that lets the script run
Running it. Microsoft’s examples use -Filter and -Recurse. Change to the top folder of your archive copy and run:
# Allow scripts in this PowerShell window only, and unblock the downloaded file
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Unblock-File "C:\Scripts\Convert-PubFileToPDF.ps1"
cd "D:\PubArchive-copy"
& "C:\Scripts\Convert-PubFileToPDF.ps1" -Filter "*.pub" -Recurse
Microsoft only says to use an appropriate execution policy. Limiting it to the current window, as shown here, is our suggestion.
What to expect (Microsoft Q&A):
- It keeps going when a file fails, then shows which files converted and which didn’t.
- If a PDF with the same name already exists, that file is skipped with an error. Re-running is safe; to redo a file, delete its PDF first.
- It produces PDFs only. There’s no direct route from Publisher to PowerPoint, and the scriptable path to Word goes through PDF (LazyAdmin).
- Test it on your pilot folder first to see where the PDFs are written.
- Publisher is now unsupported software. Run the batch on a PC used only for this job, and only on your own files.
Route 2: LibreOffice from the command line (free)
LibreOffice can convert files without opening a window. The --convert-to option implies headless mode, and --outdir sets where the output goes.
Simple case: one folder (Mac or Linux; on Mac use the full path shown below):
soffice --headless --convert-to pdf --outdir ./pdf ./pubs/*.pub
Whole archive, PDF next to each .pub, folders kept. Run these on a copy of the archive.
Windows (PowerShell). soffice.com is LibreOffice’s console version. Unlike soffice.exe, it prints errors to the window:
$soffice = "C:\Program Files\LibreOffice\program\soffice.com"
Get-ChildItem "D:\PubArchive-copy" -Recurse -Filter *.pub | ForEach-Object {
& $soffice --headless --convert-to pdf --outdir $_.DirectoryName $_.FullName
}
Mac (Terminal):
SOFFICE="/Applications/LibreOffice.app/Contents/MacOS/soffice"
find "$HOME/PubArchive-copy" -iname '*.pub' -print0 |
while IFS= read -r -d '' f; do
"$SOFFICE" --headless --convert-to pdf --outdir "$(dirname "$f")" "$f" < /dev/null
done
Linux (the timeout stops a damaged file from stalling the run):
find /srv/pub-archive-copy -iname '*.pub' -print0 |
while IFS= read -r -d '' f; do
timeout 180 soffice --headless --convert-to pdf --outdir "$(dirname "$f")" "$f" < /dev/null
done
Find what didn’t convert. Windows:
Get-ChildItem "D:\PubArchive-copy" -Recurse -Filter *.pub |
Where-Object { -not (Test-Path ([IO.Path]::ChangeExtension($_.FullName, ".pdf"))) } |
Select-Object -ExpandProperty FullName
Mac or Linux:
find ~/PubArchive-copy -iname '*.pub' | while IFS= read -r f; do
[ -e "${f%.*}.pdf" ] || echo "MISSING: $f"
done
Things that trip people up:
- Close LibreOffice first. If a LibreOffice window is open, a headless command can hand its job to that window and seem to do nothing.
- Running in parallel needs one profile per process. Two LibreOffice processes can’t share a user profile, so give each worker its own with
-env:UserInstallation(details):
On Windows the profile looks likesoffice -env:UserInstallation=file:///tmp/lo-worker-1 --headless --convert-to pdf --outdir out/part1 part1/*.pub & soffice -env:UserInstallation=file:///tmp/lo-worker-2 --headless --convert-to pdf --outdir out/part2 part2/*.pub & wait-env:UserInstallation=file:///C:/Temp/lo-worker-1. Each worker uses its own memory, so two to four workers is plenty for an office PC. - Other formats.
--convert-to odggives editable LibreOffice Draw files.--convert-to pnggives only the first page. For images of every page, convert to PDF first, then split the PDF with a tool such aspdftoppm -r 150 -png file.pdf page. - Stuck processes. If a run is interrupted and LibreOffice then refuses to start, look for a leftover
soffice.binprocess and end it.
Route 3: Our converter (no install, folders kept)
If scripting isn’t your thing, or you’d like a report you can hand to your supervisor, the converter on this site lets you convert multiple .pub files to PDF in one upload, from a handful to a whole archive. It runs the same libmspub importer as LibreOffice, then repairs some of its layout problems: a story in linked boxes on the same page flows in order, and text wraps around pictures. On top of that you get no setup, the preview and the paperwork.
- Upload a folder, a set of files, or a ZIP. Up to 2,000 .pub files per batch, 25 MB per file, and 1 GB uncompressed per ZIP. Other files in a ZIP are skipped and listed.
- Preview first. You get a free, watermarked preview of every page for the first 10 files in the batch, so you can judge quality on your own files.
- Pay once, only for what converts: $5 for up to 10 files, $15 for up to 60, $29 for up to 300, $59 for up to 2,000. Files that fail aren’t counted. See pricing.
- Download one ZIP that mirrors your folders. Each file comes with a print-ready PDF, an editable ODG, a text-only DOCX and 150 dpi PNG and JPG images of every page. A
report.csvlists each file’s path, status, page count, warnings (such as substituted fonts or a page that looks blank) and a plain-English reason for any failure. - No account. Each file is converted in a locked-down sandbox with macros disabled, and everything is deleted after 24 hours.
Start on the converter page to convert your .pub files to PDF in bulk.
Related guides
Frequently asked questions
Can I bulk convert Publisher files without Publisher?
Yes. LibreOffice can convert whole folders from the command line for free, on Windows, Mac or Linux. Our converter does it online with nothing to install, and adds layout repairs, a per-file report and page images.
Does Microsoft's script work if we had Publisher through Microsoft 365?
Only if Publisher is still installed and licensed on that PC. Microsoft removed Publisher from Microsoft 365 starting October 1, 2026, so in practice you need a one-time-purchase copy such as Publisher 2016, 2019 or 2021.
How many files can your converter take at once?
Up to 2,000 .pub files per batch, up to 25 MB each, and ZIP uploads up to 1 GB uncompressed. Split bigger archives into batches, for example by year.
Will our folder structure be kept?
Yes. The download ZIP mirrors your original folders, with each file's PDF, ODG, text-only DOCX and page images next to each other, plus a report.csv listing every file.
Should we delete the .pub files after converting?
No. Keep the originals, read-only, alongside the PDFs. They take little space, and better conversion tools may appear later.
How long will a big archive take?
It depends on file size, pictures and your computer. Convert a pilot batch of about 50 files, time it, and multiply. Image-heavy files take longer than simple ones.
Sources
- Microsoft Support: Publisher retirement FAQ, including the sample PowerShell scriptsupport.microsoft.com
- Microsoft Q&A: how to run Convert-PubFileToPDF.ps1learn.microsoft.com
- Microsoft Q&A: End of Publisher (script usage and errors)learn.microsoft.com
- LazyAdmin: Microsoft Publisher retires, do this final file checklazyadmin.nl
- LibreOffice Help: Starting LibreOffice software with parametershelp.libreoffice.org
- Ask LibreOffice: --convert-to commands in parallelask.libreoffice.org
- Ask LibreOffice: Convert docx to pdf via the command line on Windows (soffice.com)ask.libreoffice.org
- LibreOffice bug 157425: PNG export only produces the first pagelibreoffice.org
- Microsoft Support: Microsoft Publisher will no longer be supported after October 2026support.microsoft.com