Is your PDF sitting to the left of the page instead of centered where you want it? This is a common result of how PDF Embedder sizes the viewer, and it’s fixable with a small CSS adjustment.
This guide explains why your PDF may not be centered by default and covers two ways to center it, depending on your theme.
Why Your PDF Isn’t Centered by Default
The plugin displays your PDF at maximum width by default, filling the available area on the page.
If you set a fixed width smaller than the available area, the PDF is left-justified within the main content area of your page instead of centering automatically.
Centering the PDF with CSS
div.pdfemb-viewer {
margin: 0px auto !important;
}
Code language: CSS (css)
This rule targets div.pdfemb-viewer, the container PDF Embedder wraps around your PDF viewer. Centering depends on your theme’s existing CSS and layout, so this snippet may need adjusting to work with your theme; if it doesn’t center the PDF on its own, ask your web designer to review your theme’s styles and confirm what needs to target div.pdfemb-viewer.
Adding the CSS to Your Site
The method you use depends on whether your theme is a classic theme or a block theme.
Classic Themes
You can add the CSS above through Appearance > Customize > Additional CSS.
Block Themes
For themes that support the Block Editor, wrap the PDF Embedder block in a Group block and configure the Group block to center all content inside it. This centers the PDF without editing any CSS.