Welcome Guest Search | Active Topics | Sign In | Register

EO.PDF header and footer Options
Solo
Posted: Monday, September 26, 2016 1:37:30 PM
Rank: Newbie
Groups: Member

Joined: 3/19/2013
Posts: 2
At some point, possibly after upgrading to version 16, my headers and footers disappeared. I've tried multiple things to no avail. Any help would be appreciated. Here is my very simple code, and before you ask, YES, the session variables are populated:

protected void btnExport_Click(object sender, EventArgs e)
{
//Render the current page to PDF
EO.Pdf.HtmlToPdf.Options.OutputArea = new RectangleF(0.5f, 0.5f, 7.5f, 10f);
EO.Pdf.HtmlToPdf.Options.AutoFitX = HtmlToPdfAutoFitMode.ShrinkToFit;
EO.Pdf.HtmlToPdf.Options.ZoomLevel = 0.7f;
EO.Pdf.HtmlToPdf.Options.PageSize = EO.Pdf.PdfPageSizes.A4;

if (Session["ReportHeader"] != null)
{
EO.Pdf.HtmlToPdf.Options.HeaderHtmlFormat = Session["ReportHeader"].ToString();
}

if (Session["ReportFooter"] != null)
{
EO.Pdf.HtmlToPdf.Options.FooterHtmlFormat = Session["ReportFooter"].ToString();
}

EO.Pdf.HtmlToPdf.Options.InvisibleElementIds = "non-printable;button-non-printable";
EO.Pdf.HtmlToPdf.Options.VisibleElementIds = "printable;pnlContent";
string filename = Session["ExportReportFileName"].ToString();
ASPXToPDF1.RenderAsPDF(filename);

Session["ReportHeader"] = null;
Session["ReportFooter"] = null;
}
eo_support
Posted: Tuesday, September 27, 2016 11:57:49 AM
Rank: Administration
Groups: Administration

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

We tested this here with the latest build and it works fine. So it may have something to do with your HTML. In that case please try to isolate the problem into a test project and send the test project to us:

https://www.essentialobjects.com/forum/test_project.aspx

Once we have that we will look into it as soon as possible.

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.