Rank: Newbie Groups: Member
Joined: 7/1/2015 Posts: 1
|
I'm doing investigation for HTML to Pdf . I've a feature to implement, I can't find out clear demos or documentations for that. In this case:
<html> <table id="TableA"></table> <table id="TableB"></table> <table id="TableC"></table> </html>
At beginning ,the page size is "A4" and page header of page is "A4 header"; But for "TableB", I want to new page and set different page size and page header. To new page , I can use CSS "Page breaks" to do it. But I don't how to know to set different page size and header for the table. I tried to do it in "AfterRenderPage", but height of all tables are variable, so I can't get explicit page number of the table.
Is it possible to do it in EO. Pdf?
Thank you very much.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
You will not be able to have different page sizes in a single conversion. To use different sizes, you must call HtmlToPdf.ConvertUrl/ConvertHtml multiple times with HtmlToPdfOptions.PageSize setting to different values. You can convert into a PdfDocument object for every single conversion, then call PdfDocument.Merge to merge them together into a single PdfDocument object.
Thanks!
|