Search code examples
c#pdfpdf-generationpdfsharpmigradoc

Prevent chrome to re size PDF for printing


I am generating PDF file using migradoc library in a .NET webpage. PDF gets generated as expected. When I save the PDF from chrome to file system and print it using "Actual size" option, the resulting print is same as PDF preview. Problem is when I directly print it from chrome, apparently it gets resized, therefore the output PDF doesn't look Identical as preview (Some table borders gets disappeared). Any helping idea is appreciated.


Solution

  • You're essentially printing from two different sources. When you print the PDF document (from your file system) as "Actual Size," that size is going to be dictated by the bounding box/page dimensions specified in the document at the time that it was saved to a file.

    When you print your document image directly from Chrome, it's Chrome's print options and display options that will be in effect; e.g. Portrait vs. Landscape, to cite one obvious choice you can make. The Chrome print output will be determined by the settings in effect at the time the print job is generated.