|
Rank: Newbie Groups: Member
Joined: 1/16/2014 Posts: 7
|
Hi. We use EO.Pdf to generate pdfs from html; we want our html to entirely control the final output, and part of this involves it being able to mark a section of the document as being portrait or landscape. Ie, we would like the ability of our html to control the page dimensions for sections of the document.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi,
You will need to call HtmlToPdf.ConvertUrl separately for each section, then call PdfDocument.Merge to merge them into a single PdfDocument object. A single ConvertUrl/ConvertHtml call will not be able to support multiple sections with different width because internally the converter works like a Web Browser. For a Web Browser the whole page always have the same width from the top to the bottom.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 1/16/2014 Posts: 7
|
I understand that it internally works like a web browser, but at some stage that gets converted to a pdf with pages. Surely at this stage it would be possible to check the markup for a specific class in order to set dimensions? You already do something similar with the thead and tfoot element in tables to ensure that they repeat on each page. Dimensions could be added as an extra class when the page-break css rules are used, perhaps.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,201
|
Hi,
No. That is not possible. Repeating table header/footer is one thing, setting page dimension is a completely differently thing. A web layout engine works by first fixing the page width, then layout contents from top to bottom. It does not have the capability to switch page width in the middle. As a result, we can add "vertical varieties" such as repeating table header/footers, but we can't add "horizontal varieties". That page's width cannot change throughout the conversion.
Thanks!
|
|