Welcome Guest Search | Active Topics | Sign In | Register

Footer also resizing with ScaleToFit Options
Ronald Copal
Posted: Monday, August 21, 2017 5:32:44 AM
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
eo_support
Posted: Monday, August 21, 2017 1:51:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
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!


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.