Pro Reports PDFs are too tall, not 8.5x11

I have a custom report that was based on the “modern” report. But I’ve also looked at the base out of the box modern report, and also tested with the new “agency” reports as well.

The problem is, all the PDFs don’t come out as 8.5x11 or even fitting within that. They come out at exactly 8.2678x11.6929 inches. So that fits the width, but it’s not even close on the height.

This means if I try to print the PDF, it won’t fit the printer margins and we have to zoom it to fit. In this icase, we zoom out to 91.2% to make it fit the page. This allows the height to work, but now the width is much less than it can be on the printer. Since it was 8.2678 to start with, zooming out just makes it even skinnier.

I can’t find a reason for the wrong sizing just by looking at the template, CSS etc. I can see that margins and paddings are being set in pixels, if that matters?

I can’t be sure if this is an issue in Pro Reports itself in the PDF generator settings, or if it’s a problem in CSS and HTML/PHP in the templates. Since it’s the exact same across all the default templates and my custom one, I’m thinking it has to be in the plugin itself.

Can this be adjusted so the document comes out as proper 8.5x11 with appropriate margins? Or is there some reason the PDF is sized wrong on purpose?

The default paper format is A4. If you want to change it to US Letter, you can use a code snippet. I’ve found this answer and snippet in a previous post: Change the size of pro report pages

1 Like

Yes that worked, I had no idea there was a filter for that!

I have a snippets tool on my install, so I just added:

add_filter('mainwp_pro_reports_pdf_paper_format', function() {
    return 'letter';
});

Thanks!

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.