carloscds / HtmlToPDFCore

Convert HTML to PDF
MIT License
51 stars 25 forks source link

Disabling smart shrinking #9

Closed marcinszynkowski closed 2 years ago

marcinszynkowski commented 2 years ago

Thanks for the simple and nice library. Is there any option to disable smart shrinking? Pdf looks ok but the problem is that there is some useless empty space and not fill A4 page.

carloscds commented 2 years ago

@marcinszynkowski I have only PageMargins. Can you provide a sample about this ?

marcinszynkowski commented 2 years ago

@marcinszynkowski I have only PageMargins. Can you provide a sample about this ?

@carloscds My pdf looks something like this : https://pasteboard.co/oNm1WpDcsSHq.png

The rectangle with black border is my pdf content, and all the white is the A4-size. PageMargins gives me only the effect that the content is sticking to left up corner. Rotativa is based on wkhtml which is cmd-line tool, which has a switch "--disable-smart-shrinking". I needed a library which converts html into pdf and works in docker, and your library works but the problem is this white blank space I don't need.

carloscds commented 2 years ago

@marcinszynkowski I created an option to disdable smart shrinking. This update broke compatibility with .NET Standard 2.0

marcinszynkowski commented 2 years ago

@marcinszynkowski I created an option to disdable smart shrinking. This update broke compatibility with .NET Standard 2.0

Thank you very much! It works like a charm :)