Reputation: 125
I've recently embedded PDF.js on to a website to display PDFs and allow them to be printed.
However, when printing, a blank page is being inserted on every other page (ie pages 1,3,5.. are correct but pages 2,4,6.. are blank).
Occasionally when printing, a single page flows over to the next page (only by a line or 2) and then page breaks to the next (so a 2 page PDF becomes 4 etc) which may explain the blank page if it thinks the first page flows over to the next page by a very very marginal amount (not enough to display any text on the blank page).
The PDF displays fine in the viewer itself but so i'm not entirely sure what's going on with the printing.
Does anyone have any idea why this would be the case? I think I have a general idea about how it displays the PDF on a canvas before printing but I'm not greatly familiar with it. Any helpful pointers would be greatly appreciated!
Upvotes: 3
Views: 3188
Reputation: 52837
Check that the page size dimensions is actually Letter size (8.5 x 11). If it renders as Legal, A4, or A5 size, then that would explain why you are seeing a blank page every second page.
To see if this is the case, print to a PDF, and verify page dimensions.
You could change the paper size in the advanced printer settings to the correct format, and print to the same medium.
I could not find a "shrink-to-fit" setting for pdf.js, but if that is possible, it could mean you can print to Letter and not have blank pages printed in-between.
Upvotes: 1