This method renders all pages of the PDF document into bitmaps before sending them to the printer.
This works in all major browsers and avoids giving users direct access to the source PDF file. However, this method is CPU-bound and memory usage scales with PDF size. Memory usage might be as high as multiple gigabytes for PDFs with over 100 pages.
Because of its reliability and cross-browser support, this method is the default print mode.
Some caveats when using this method:
display: none !important. If the printed
page still contains other HTML elements, make sure to apply an appropriate print stylesheet
to your web app.This method tries to pass a PDF directly to the printing system. This provides better print fidelity and lower memory usage, but gives users access to the PDF and may open the generated PDF in a new tab/window in some browsers.
Depending on browser capabilities, this mode either:
print() directly, orThis gives users access to the PDF, either from the fallback or if they use a ‘print to PDF’ feature in the browser.
When using this print mode, we can not call the RenderPageCallback when printing pages.
Note: If the PDF is password-protected, we always fall back to opening the PDF in a new tab.
Describes mode used to print a PDF document.