How can I fix WordPress PDF layout, page size, or page breaks?
Start by identifying whether the problem is the PDF page itself, the way the web page is fitted onto it, or where the content is split across pages.
Set the PDF page first
If the paper size, orientation, or page margins are wrong, start with the Page Size, Orientation, Margin Top, Margin Right, Margin Bottom, and Margin Left options.
Use these options for the PDF page. They do not change how the WordPress page itself chooses its desktop or mobile layout.
Fix content that is too wide or cut off
If the content is cut off, too narrow, or uses an unexpected responsive layout,
adjust the
Content Viewport Width
option. Try large for a wider layout, or set a specific width such as
1024px.
If the content still does not fit the page, adjust the
Content Fit Mode option.
For many wide pages, smart-scaling is the safest first value to try.
Use the Scale Factor option only when the layout is otherwise correct and you just need to make everything slightly smaller or larger.
Remove unwanted blank pages
If the output has blank pages at the end, keep the
Remove Blank Pages
option set to trailing. If blank pages appear inside the document, try all.
If blank pages still appear, the page probably contains spacing, fixed-height sections, or page-break CSS that creates the empty area. In that case, fix the page CSS or add conversion-only CSS with the Custom CSS option.
Control page breaks with CSS
Use the Custom CSS option when you need a section to start on a new page or stay together.
.pdf-page {
break-before: page;
}
.pdf-keep-together {
break-inside: avoid;
page-break-inside: avoid;
}
Page-break rules may not work as expected inside complex layouts. If a section still splits badly, try simpler CSS for that section, such as removing flexbox or grid layout in the PDF-specific CSS.
Use print styles when your theme has them
If the site already has a good print layout, enable the Use Print Media option. This tells the converter to use the site's print CSS.
If the print layout hides content you need, leave this option disabled and tune the PDF with viewport, fit, margin, and custom CSS options instead.
Create one continuous page only when that is the goal
If you do not want page breaks at all, set the
Page Height option to -1.
Use this only for output that should behave like one long page, not for regular
printable documents.