Convert Publisher Files to PDF Locally with LibreOffice – Free

Convert a Microsoft Publisher (.pub) file to PDF on your own computer. This tool requires the local Base64Coding server and LibreOffice Draw.

Install LibreOffice on the computer running Base64Coding. Start the project with the command below, then open this page at the localhost address printed in the terminal. Choose a .pub file up to 20 MiB.
npm run dev

How to use the Local Publisher to PDF with LibreOffice tool

  1. Open this page from a local Base64Coding server at localhost or 127.0.0.1, on a computer with LibreOffice installed.
  2. Choose a .pub document of up to 20 MiB under Publisher file.
  3. Select Convert to PDF and wait. The request is allowed up to 70 seconds.
  4. Select Download to save the PDF, which keeps the original file name with a .pdf extension.

How Publisher to PDF conversion works

A .pub file is a proprietary binary document written by Microsoft Publisher. It is an OLE compound file, the same container older Office formats use, and no browser can render it. LibreOffice can: its Draw application includes an import filter, built on the open source libmspub library, that reads Publisher layouts.

This page does not parse the document itself. It checks the file name and size, then posts the raw bytes to a converter endpoint on the server it was loaded from. That server runs LibreOffice and answers with the PDF, which the page offers as a download.

Why the converter needs localhost

Before sending anything, the tool looks at the host name in the address bar. Only localhost, 127.0.0.1 and [::1] are allowed. On any other address, including the public website, it stops with the message Open Base64Coding on localhost with LibreOffice installed to use this converter, and no part of the file is transmitted.

The design keeps office documents on your machine. The upload travels over the loopback interface to a process on the same computer and does not cross the internet.

Converting a .pub file with LibreOffice directly

If you do not run a local copy of the site, LibreOffice alone does the same job. Open the .pub file in LibreOffice Draw and use File, Export as PDF. For scripts and batches, the headless command below writes brochure.pdf to the current directory. On Windows the executable is soffice.exe in the LibreOffice program folder.

soffice --headless --convert-to pdf brochure.pub

Error messages and fidelity limits

The import filter was written by reverse engineering, so the PDF may differ from what Publisher prints. Fonts that are missing on your computer are substituted, which can reflow text, and some effects or linked objects may not appear. Compare the result with the original before you send it to a printer.

  • Choose a .pub file up to 20 MiB: no file was selected, the name does not end in .pub, or it is larger than 20,971,520 bytes.
  • The local Publisher converter is unavailable: the server returned an error without details, for example because the endpoint or LibreOffice is missing.
  • A timeout error: the conversion did not finish within 70 seconds.

Frequently asked questions

Can I convert a .pub file to PDF without Microsoft Publisher?

Yes. LibreOffice opens Publisher documents through its libmspub import filter and can export them as PDF. This tool uses that route on a local server, and LibreOffice Draw can do it by hand.

Why does the converter tell me to open Base64Coding on localhost?

The conversion depends on LibreOffice, which a browser cannot run. The page therefore only sends the file when it is served from localhost, 127.0.0.1 or [::1], where a local converter can receive it.

Is my Publisher file uploaded to the internet?

No. The request goes to the server on your own computer over the loopback address. When the page is opened from a public address, the tool refuses to send the file at all.

Will the PDF look exactly like my Publisher document?

Not always. Substituted fonts, text effects and complex grouped objects can shift or drop out. Install the fonts the document uses to get closer to the original layout, and proofread the PDF.

What is the largest .pub file I can convert?

20 MiB. Larger files are rejected in the browser before any request is made. Publications with many high-resolution pictures can exceed that, so compress or remove images in the source if needed.

Related tools