Hi,
I am adding headers and footers to my converted doc using an AfterRenderPage handler.
I am doing a HtmlToPdf.ConvertHtml on each footer because I have page numbers and each footer is different.
However, the header does not change as often and rather than waste resources converting the header each time, I want to remember the HtmlToPdfResult of the conversion and simply add it to each page.
I can't figure it out. I first tried:
Code: Visual Basic.NET
e.Page.Contents.Add(HeaderResult.PdfDocument.Pages(0).Contents(0))
But I got the error: The object already has an owner. Please use a clone of the object instead
So I dug around and tried this to clone the document:
Code: Visual Basic.NET
e.Page.Contents.Add(HeaderResult.PdfDocument.Clone(0, 1).Pages(0).Contents(0))
But I get the same error.
So what is the correct way to add an existing HtmlToPdfResult to a page?
Thanks,
Brad