|
Rank: Newbie Groups: Member
Joined: 5/3/2013 Posts: 5
|
Hi,
I am using the ConvertUrl method and Options.VisibleElementIds to generate a PDF and it is working with one drawback.
For some reason a scrollbar is appearing on the right hand side, the full height of the PDF.
The scroll bar is not shown on the web page being converted and the <div> that is being extracted is not particularly high.
How do I suppress this?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Can you isolate the problem into a test HTML file and post the HTML file? We will be very happy to take a look as soon as we have that.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/3/2013 Posts: 5
|
Hi, It's not easy to isolate the HTML ..... I am pointing at a SharePoint 2010 Web Part page ( and looking for a specific DIV within in ). I found this internet facing SharePoint page : http://www.toddklindt.com/default.aspxAnd when I try to PDF it I get the same results .... a horizontal and vertical browser scrollbar. You can see the same result on your online converter demo.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
The vertical scroll bar is caused by your HTML. You will see that scroll bar even in your browser.
The horizontal scroll bar appears because by default, a "PDF page" is narrower than a typical browser window. By default the PDF page is 6.5 inch wide (8.5 inch excluding one inch margin on each side), at 96 pixel/inch that will be 624 pixel. If you narrow your browser window to that size, you will see horizontal scroll bar too.
There are two ways to eliminate the horizontal scrollbar: the increase the paper size (setting HtmlToPdf.Options.PageSize), or to change the zoom level (HtmlToPdf.Options.ZoomLevel). For example, if you set ZoomLevel to 0.5, then the same 6.5 inch wide paper will fit 624 / 0.5 = 1248 pixels, that is wide enough to eliminate horizontal scrollbars for most pages because many pages are designed to fit 1028 pixels wide.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/3/2013 Posts: 5
|
Unfortunately even if I increase the page size ( I set it to a height of 10 * A4 ) or set the zoom level I am still getting a vertical scrollbar.
The actual contents of the PDF are generated perfectly which is very frustrating as it's not usable with a rouge scrollbar!
|
|
Rank: Newbie Groups: Member
Joined: 5/3/2013 Posts: 5
|
Is there any way to "crop" the generated PDF? If I could slice off a couple of inches from the right-hand it would work nicely.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
No. I do not believe there is anything to do that. As to the vertical scrollbar, we have already told you very clearly that you will need to modify your HTML to fix that.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/3/2013 Posts: 5
|
Hi,
That's a shame. The software I am trying to integrate into is a SharePoint web part and thus I don't have access to the overall HTML that is used to generate a page.
So near.... yet so far. Never mind.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
The goal of the HTML to PDF converter is to render your HTML faithfully. We can not invent things off the standard by ourselves. So if your HTML generates a scrollbar, a browser will render a scroll bar, and we will render a scrollbar. It is not practical for us to add additional logic on top of that. Rendering the result exactly the same as a browser is the goal here. So we can not change that. Hope you understand.
Thanks!
|
|