Welcome Guest Search | Active Topics | Sign In | Register

Render Header from url Options
Becky
Posted: Friday, May 25, 2012 6:14:19 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
Hi,
I have some code to put a header and footer on my pages. Currently it is creating acmText("Page Header") .....

What I would like to do is create the header from a url where I have the header file already created.
This is my code to define the header.
Code: Visual Basic.NET
Dim header As New Acm.AcmBlock(New Acm.AcmText(String.Format("Page Header - Page {0}", doc.Pages(I).Index)))
            header.Style.Border.Bottom = New Acm.AcmLineInfo(Acm.AcmLineStyle.Solid, Color.Black, 0.01F)
            header.Style.Top = 0.6F



Thanks,
Becky
eo_support
Posted: Friday, May 25, 2012 6:37:11 PM
Rank: Administration
Groups: Administration

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

If you use HTML to PDF converter, the easiest way to create header and footer is through HtmlToPdf.Options.HeaderHtmlFormat/FooterHtmlFormat. Those two properties take HTML. AcmText on the other hand, does not understand HTML.

If you have the header HTML in a file, you will need to write code to read them into a string first because both HeaderHtmlFormat/FooterHtmlFormat and AcmText takes strings. They do not take Urls. Only the main HTML to PDF interface ConvertUrl takes Url. The code to fetch a Url is rather simple, you can search online if you are not familiar with it. There should be plenty of articles describing how to do it.

Thanks!
Becky
Posted: Friday, May 25, 2012 6:53:58 PM
Rank: Advanced Member
Groups: Member

Joined: 5/24/2012
Posts: 45
OK, I can work with that. 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.