LibreOffice Writer Exported Content Loses Website Formatting When I Convert My Web Content to PDF

Hello LibreOffice Community,

I am currently facing one specific problem with LibreOffice Writer while preparing content for my website, and I am hoping someone can help me understand why the formatting changes when I export the document to PDF. I use LibreOffice Writer to prepare some of the website’s long-form content before publishing it online, and the document looks correct inside Writer, including headings, paragraphs, spacing, tables, and other layout elements. However, after I export the Writer document as a PDF and use that PDF as part of my website’s downloadable content, some of the formatting does not remain exactly as it appeared in the original Writer document. The text itself is generally present, but certain elements can shift position or spacing can change in the resulting PDF. The issue is specifically with preserving the Writer document’s layout during PDF export, rather than with the website failing to display the PDF.

I have checked the original Writer document carefully and confirmed that the formatting is correct before exporting it. The headings have the expected styles, paragraphs are arranged properly, and the document looks consistent when viewed directly in LibreOffice Writer. The problem becomes visible only after creating the PDF. In the affected documents, some content that was positioned correctly in Writer can move slightly when viewed in the exported PDF, and sections containing longer text can sometimes occupy a different amount of space than expected. This becomes particularly noticeable when the document contains a mixture of headings, normal paragraphs, and structured content. I have repeated the export using the same document and have been comparing the Writer version with the resulting PDF page by page. Since the source document itself remains correct, I am trying to determine whether there is a particular Writer formatting or page-layout setting that could cause this difference during PDF generation.

The issue is important because the PDF is intended to be accessed by visitors through my website, so I need the downloadable version to preserve the same professional layout that I created in Writer. I have already checked the page size, margins, paragraph spacing, and basic document formatting, but I have not yet found one setting that consistently prevents the layout changes. I am especially interested in understanding how Writer handles fonts and line wrapping during PDF export because a small change in text metrics can cause later paragraphs or headings to move to a different position on the page. The document can look completely correct inside Writer while the exported PDF produces a slightly different page arrangement. I have therefore started comparing the fonts used in the document and checking whether all of them are installed locally and correctly embedded in the exported PDF.

I have also tried exporting the same document more than once to make sure the issue is not simply caused by a temporary export problem. The PDF is generated successfully each time, and there is no error message during the export process. The resulting file can be opened normally in a PDF viewer, but the formatting difference remains. I have also tested the PDF independently from the website so that I can confirm the problem exists in the generated document itself rather than being introduced by the website’s PDF viewer or browser. This has helped narrow the problem down to the document/export stage. I am now trying to understand whether Writer has any diagnostic options or recommended settings for ensuring that page layout, fonts, spacing, and styles are preserved as closely as possible when generating PDFs for web distribution.

I am currently testing the document by simplifying some of the formatting and comparing the exported result after each change. I am also checking whether the issue is more likely to occur when using particular paragraph styles, page breaks, or font combinations. However, because the document contains a significant amount of website content, I would prefer not to manually rebuild every section using simpler formatting unless that is actually necessary. I would like to identify the underlying cause so I can use the same reliable workflow for future documents. If there are specific Writer settings related to PDF export, font embedding, layout compatibility, pagination, or style handling that I should inspect, I would appreciate recommendations on what to check first.

I would appreciate guidance from the LibreOffice community on how to troubleshoot this specific situation where a Writer document looks correctly formatted inside LibreOffice but its exported PDF does not always preserve the same page layout when the PDF is prepared for distribution through my website. In particular, I would like to know which Writer formatting settings, font considerations, page-layout options, or PDF export settings could cause text spacing and positioning to change during export. I would also appreciate advice on how to determine whether the difference is caused by font substitution, pagination, paragraph styles, or another document-layout feature. My goal is to create PDFs from Writer that retain the intended formatting as closely as possible so that visitors downloading the documents from my website see the same professional layout that I created in the original Writer file. Sorry for long post!

Length is not the problem, but lack of any details…
Usually we ask here for the version of LibreOffice you use, as well as the OS involved. If it is possible, it would be interesting to have a Writer-document and your created pdf for inspection (together with some hints where something is unexpected for you.

Without anything to look at I can only offer a blind shot:
Are the fonts you use

  • available for pdf-viewer/website?
  • embedded in the pdf ?

Font-substitution may cause shifted text.

1 Like

Yes and
…styles have been used throughout, with no direct formatting whatsoever.

That makes sense, and I agree that the font side is probably worth checking first. I’m using LibreOffice Writer to create the document and then exporting it directly to PDF, so I’ll check the exact LibreOffice version and operating system and include those details in a follow-up. I’ll also compare the Writer file with the exported PDF and point out the specific pages or sections where the spacing or positioning changes rather than just describing the issue generally.

I’ll check the fonts as well, including whether the fonts are actually embedded in the PDF and whether the same fonts are available to the PDF viewer. I hadn’t considered that font substitution could be responsible for the differences that appear later in the document, especially where line wrapping changes and pushes subsequent content onto a different position or page. If the fonts are not embedded, I’ll test the export with fonts that can be embedded and compare the result. Thanks for pointing me toward the font-substitution possibility; I’ll gather the version, OS, source document, PDF, and specific examples so there is something concrete to inspect.