Welcome Guest Search | Active Topics | Sign In | Register

aspx to pdf: Height cutting off Options
jcutrono
Posted: Tuesday, March 27, 2012 8:44:11 AM
Rank: Newbie
Groups: Member

Joined: 3/27/2012
Posts: 2
I am testing the demo dlls and I am not sure if this is just a problem with them being the demo or not.

1. The bottom of the PDF is cutting off. I am trying to provide a high pagesize.Height, but it does not seem to get any longer. Code:

HtmlToPdf.Options.VisibleElementIds = "myContent";

SizeF pageSize = PdfPageSizes.Legal;
HtmlToPdf.Options.PageSize = pageSize;
HtmlToPdf.Options.OutputArea = new RectangleF(0, 0, pageSize.Width + 2, pageSize.Height + 200);

HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ShrinkToFit;

ASPXToPDF1.RenderAsPDF("notes.pdf");

The rendered PDF cuts off the content on the bottom.

2. Also there is a scrollbar on the rendered pdf inside the content. This scrollbar obviously cannot do anything. Is this a problem with having a scroll bar on my page? If so, why can't the generator just render ALL the content without the scroll bars?
eo_support
Posted: Tuesday, March 27, 2012 10:07:17 AM
Rank: Administration
Groups: Administration

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

I am not sure why you set OutputArea to be bigger than page size. When you do that the contents will certainly be cut off.

As to scrollbars, when you view a web page in a browser, there are two types of scroll bars: scroll bars on the browser window and scroll bars on an element. The later can be triggered by something like this:

Code: HTML/ASPX
<div style="width:100px;height:100px;overflow:auto;">
   <div style="width:200px;height:200px;">
   </div>
</div>


We will not display the scroll bars on the browser window. However we will display scrollbars on HTML elements faithfully as is. If you want to remove those scrollbars, you have to modify your HTML. Note that sometimes even if your HTML does not display scrollbars in one browser, it may display scrollbars in another browser. Our rendering is most close to Google Chrome. So you can use Chrome to verify the output first.

Hope this helps. Please let us know if you have any more questions.

Thanks!
jcutrono
Posted: Tuesday, March 27, 2012 2:21:28 PM
Rank: Newbie
Groups: Member

Joined: 3/27/2012
Posts: 2
I removed the modifications to the OutputArea and the problem persists. I think it might be more related to your second comment about the the divs. The content being displayed is larger that the window can support so there is a scroll. Is there a way to render all content to the pdf without the scroll bars?
eo_support
Posted: Tuesday, March 27, 2012 2:32:47 PM
Rank: Administration
Groups: Administration

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

I don't think you understood our previous reply. Our previous reply clearly mentioned "We will not display the scroll bars on the browser window", that means we do not render scroll bars because your content is larger than the window.

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.