Welcome Guest Search | Active Topics | Sign In | Register

Eo.PDF HtmlToPdf.ConvertHtml wont fill the page Options
John Barton
Posted: Thursday, December 7, 2017 10:07:17 AM
Rank: Newbie
Groups: Member

Joined: 9/10/2012
Posts: 4
Hi,

I am trying to create a document with a landing page and loading some static html, using the following html options it will fill the page horizontally but only use about 2/3's of the page vertically.

var HtmlFileLoadOptions = new HtmlToPdfOptions
{
BaseUrl = "http://" + ConfigurationManager.AppSettings["ServerName"],
GeneratePageImages = true,
JpegQualityLevel = 100,
AutoAdjustForDPI = true,
UsePrintMedia = true,
NoCache = true
};

I did try using the option AutoScaleX to ScaleToFit which would make it fit the height but not the full width, is there any option to scale it to fill the page completely?
eo_support
Posted: Thursday, December 7, 2017 1:16:32 PM
Rank: Administration
Groups: Administration

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

The HTML to PDF converter will scale the page for you automatically but it will never apply different scales on X and Y direction. In another word, if on X direction is scaled by 50%, then the same scale level will be applied on Y level as well. In another word, the HTML to PDF converter will not stretch the page on a single dimension to distort your page.

This means if the contents fill the X direction but does not fill the Y direction, it is impossible for you to just stretch Y direction. You will need to do either of the two:

1. Change your PDF page size to reduce the height of the page;
2. Change your HTML to increase the height of your HTML content;

Hope this make sense to you. Please feel free to let us know if you have any more questions.

Thanks!


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.