Welcome Guest Search | Active Topics | Sign In | Register

How do I set the EO PDF header and footer? Options
W Chen
Posted: Thursday, June 11, 2015 2:49:59 PM
Rank: Newbie
Groups: Member

Joined: 6/11/2015
Posts: 1
I'm having a little difficulty setting the header and footer for my PDF - the page content and the header ends up overlapping.

My header is an image with a height of 50px, footer is an image with a height of 10px.

Below is a snippet of my code (vb.net):
Code: Visual Basic.NET
EO.Pdf.HtmlToPdf.Options.PageSize = New System.Drawing.SizeF(8.5F, 11.0F)
EO.Pdf.HtmlToPdf.Options.OutputArea = New System.Drawing.RectangleF(0.5F, 0.5F, 7.5F, 10.0F)

EO.Pdf.HtmlToPdf.Options.HeaderHtmlFormat = "<img src=blah blah blah>"
EO.Pdf.HtmlToPdf.Options.FooterHtmlFormat = "<img src= blah blah blah>"

ASPXToPDF1.RenderAsPDF()


How would I prevent the header from overlapping with the content?
Is there a way for me to define the top and bottom margin separately?

TIA
eo_support
Posted: Thursday, June 11, 2015 5:38:07 PM
Rank: Administration
Groups: Administration

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

Setting HtmlToPdf.Options.OutputArea indirectly defines all margins.

In your case, you need to adjust the header/footer location by setting HtmlToPdf.Options.HeaderHtmlPosition and HtmlToPdf.Options.FooterHtmlPosition.

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.