Rank: Newbie Groups: Member
Joined: 8/21/2017 Posts: 1
|
After renderig the HTML page, we add an extra page with a SVG in it. This works fine and the footer is displayed correctly. However , in the added page (with SVG), the footer is equally scaled with the page. How can I prevent the footer of beeing scaled as well?
Private Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click svgViewer.InnerHtml = Session("svg")
' svgViewer.Visible = False
HtmlToPdf.Options.VisibleElementIds = "PDFcontents"
EO.Pdf.HtmlToPdf.Options.FooterHtmlFormat = "<style>body {font-family: arial} .pagefooter { color:red; font-size: 11px }</style><div class='pagefooter'>" + getFooter() + "</div>" EO.Pdf.HtmlToPdf.Options.PageSize = New SizeF(PdfPageSizes.A4.Width, PdfPageSizes.A4.Height) EO.Pdf.HtmlToPdf.Options.OutputArea = New RectangleF(0.0F, 0.8F, PdfPageSizes.A4.Width, PdfPageSizes.A4.Height - 1.6) ASPXToPDF1.RenderAsPDF(Now.ToString("yyyyMMdd") + "-" + Session("project") + "-" + Obj.Display + ".pdf")
End Sub
Public Sub AfterRender() Handles ASPXToPDF1.AfterRender Dim doc = HtmlToPdf.Result.PdfDocument
Dim options As HtmlToPdfOptions = New HtmlToPdfOptions options.PageSize = New SizeF(PdfPageSizes.A3.Height, PdfPageSizes.A3.Width) options.OutputArea = New RectangleF(0.0F, 0.0F, PdfPageSizes.A3.Height, PdfPageSizes.A3.Width) options.AutoFitX = HtmlToPdfAutoFitMode.ScaleToFit options.AutoFitY = HtmlToPdfAutoFitMode.ScaleToFit options.FooterHtmlFormat = "<style>body {font-family: arial } .pagefooter { color:red; font-size: 11px } </style><div class='pagefooter'>" + getFooter() + "</div>"
EO.Pdf.HtmlToPdf.ConvertHtml("<html><head> <link href = """ + Session("baseurl") + "/CSS/reset.css"" rel=""stylesheet"" /> <link href = """ + Session("baseurl") + "/CSS/design.css"" rel=""stylesheet"" /> </head><body>" + Session("svg") + "</body></html>", doc, options)
End Sub
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,225
|
Hi,
You will need to change your footer HTML to achieve that, for example, you can use a larger font-size value. There is no way to override the footer's zoom level because it always use the same zoom level as the main contents.
Thanks!
|