Rank: Member Groups: Member
Joined: 4/30/2013 Posts: 11
|
Hi we are trying to convert following page to pdf using HtmlToPdf.ConvertUrl. But if you look at the converted pdf, it is cutting half of the page. Any way to correct it? http://cbplp-qa-legacy1.cn-qa-stage.catnav.us/printitems/all-categories-generic-items/all-categories-generic-items-itemsonlyLive Demo - http://essentialobjects.com/Products/EOPdf/UrlToPdf.aspxYou can verify the behavior by using your live demo and punching above mentioned url. If you need any additional info, please let me know. Thanks -nilesh
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
You can set HtmlToPdf.Options.ZoomLevel to a small value such as 0.5. The reason that it gets chopped off is by default, a PDF "paper" is narrow than a browser window. The default PDF paper size is 8.5 inch wide, excluding margins its only 468 pixels. If you resize your browser window to that size, you will see it chops off the HTML as well. Setting ZoomLevel to a smaller value increases the pixel width of the "window" used by the converter. If you set it to 0.5, then the pixel size doubles as 936.
The converter is also able to automatically detects the minimum width of your page and adjust to it. So if you have something like this: <div style="width:1000px"> </div>, then the converter will see it and automatically adjust zoom level so that a converter "window" is at least 1000 pixel wide.
Thanks!
|