IronPdf / Iron-Pdf-Documentation

ReadTheDocs Build Files for IronPDF C#/.Net PDF Library http://ironpdf.com
8 stars 2 forks source link

PDF generation differences between IronPDF and Chrome browser #5

Open djimmo opened 5 years ago

djimmo commented 5 years ago

Hi IronPDF,

I have also mailed you, but did not receive any answer. I was wondering why there are differences in the PDF generation between IronPDF and Chrome browser. Layout changes when using IronPDF and the css property { page-break-after: always; } behaves differently.

In chrome the { page-break-after: always; } starts a new page on and keeps the margin where this pages is started the same for all subsequent pages. When using IronPDF every new page break the content moves slightly up, so after 10 pages the page breaks don't work anymore. What causes this difference?

I have attached the print from Chrome browser testgood.pdf and also the print from IronPDF testbad.pdf to better illustrate the differences.

Another issue I see to have it that IronPDF is less strict with css styling, what causes this difference? See the following examples: Printed in Chrome: columnwidthgood.pdf and printed with IronPDF: columnwidthbad.pdf. As you can see the columns are less wide when printing with IronPDF, especially noticable on the 'Afzender naam' field

I hope you can help me fix these slight issues that I am having.

regards, Djim

asfarley commented 3 years ago

I just ran into this myself after purchasing IronPDF. I hope there is a way to deal with page breaks as @djimmo mentioned.

asfarley commented 3 years ago

Nevermind, explicitly setting the CSS meda type to print fixed the issue with the page-breaks:

https://stackoverflow.com/questions/59179499/ironpdf-print-to-margin