Welcome Guest Search | Active Topics | Sign In | Register

Single page PDF Options
Petr Decky
Posted: Wednesday, March 3, 2021 7:53:07 AM
Rank: Newbie
Groups: Member

Joined: 3/3/2021
Posts: 2
Hello, I'm using EO.Pdf for generating PDF files from html source. Is it possible set page height to some auto-adjust value in order to generate single page PDF, containing whole HTML document?
eo_support
Posted: Wednesday, March 3, 2021 11:10:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,081
Hi,

There is no built-in support for this. In theory you can run the conversion twice. The first time you use it "measure" the height of your web page, then you can set your page size based on the result of this conversion. However this is not recommended as it would generate "non-standard" page sizes and it might cause problems with some PDF Viewer or during printing.

You can however set HtmlToPdf.Options.AutoFitX and AutoFitY to ShrinkToFit. In that case it will always zoom your HTML page to fit into a single page. Note that this option does not change the PDF page size, it scales your web page to fit the PDF page instead.

Thanks
Petr Decky
Posted: Wednesday, March 3, 2021 12:39:02 PM
Rank: Newbie
Groups: Member

Joined: 3/3/2021
Posts: 2
Hi,
thank you for your tip, two stage conversion may work for me. Non-standard page size is not an issue, source HTML contains a pos (cash) receipt of a variable length.

Bye.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.