Welcome Guest Search | Active Topics | Sign In | Register

Ability to set page dimensions for a section of html for EO.Pdf Options
Dimitri Daras
Posted: Tuesday, January 21, 2014 6:58:32 AM
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.
eo_support
Posted: Tuesday, January 21, 2014 9:14:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
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!
Dimitri Daras
Posted: Tuesday, January 21, 2014 12:05:10 PM
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.
eo_support
Posted: Thursday, January 23, 2014 10:16:15 AM
Rank: Administration
Groups: Administration

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


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.