Welcome Guest Search | Active Topics | Sign In | Register

EO.Pdf .NET Page Wrapping for AcmParagraphs Options
Segphault
Posted: Tuesday, July 2, 2013 11:22:52 AM
Rank: Newbie
Groups: Member

Joined: 7/2/2013
Posts: 4
We're evaluating the EO.Pdf .NET library for use in a large, enterprise application. We're trying to create a multi-column PDF like the one pictured in this image, but we've encountered two problems:

1) In a two-column layout, such as the one pictured above, is there any way to prevent wrapping the page/column in the middle of a paragraph as shown in question #10? Question #10 and its answers (A-F) are all part of a single paragraph, so I would like for it to be forced to a new column/page as a whole if it doesn't fit. I read here that it is possible to do this with the HtmlToPdf portion of the library, but I don't see an equivalent in the PDF Creator (Acm) library.

2) Is there any way to render a portion of the text as HTML? For example, question #10 contains <br/> tags, but content could also be bolded, italicized, etc. We would prefer not to render our entire document using the HtmlToPdf library because it add significant additional overhead for us. I checked the ConvertHtml documentation and the AcmStyle/AcmStyleSheet documentation, but I don't see a way to render a particular AcmText object/string as HTML. Is this possible with EO.Pdf?


eo_support
Posted: Tuesday, July 2, 2013 11:40:33 AM
Rank: Administration
Groups: Administration

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

To prevent a block from wrapping into another page/column, put them inside a div and then apply "page-break-inside:avoid" to that DIV:

http://www.essentialobjects.com/doc/4/htmltopdf/paging.aspx

To render a portion of the your page, you can set HtmlToPdf.Options.VisibleElementIds property:

http://www.essentialobjects.com/doc/4/eo.pdf.htmltopdfoptions.visibleelementids.aspx

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Segphault
Posted: Tuesday, July 2, 2013 11:47:25 AM
Rank: Newbie
Groups: Member

Joined: 7/2/2013
Posts: 4
segphault wrote:

but I don't see an equivalent in the PDF Creator (Acm) library.


eo_support wrote:

To prevent a block from wrapping into another page/column, put them inside a div and then apply "page-break-inside:avoid" to that DIV:

http://www.essentialobjects.com/doc/4/htmltopdf/paging.aspx


I linked to this in the question. We're not using the HtmlToPdf portion of the library, we're using the PDF Creator (Acm) library.

How does this apply to Acm objects? Do you have an example?

eo_support wrote:

To render a portion of the your page, you can set HtmlToPdf.Options.VisibleElementIds property:

http://www.essentialobjects.com/doc/4/eo.pdf.htmltopdfoptions.visibleelementids.aspx


Again, we're using the Acm objects. How does this apply to AcmText, etc?
Segphault
Posted: Tuesday, July 2, 2013 11:56:12 AM
Rank: Newbie
Groups: Member

Joined: 7/2/2013
Posts: 4
To be clear, here is the code used to create the document depicted in the image (note: there are no references to the HtmlToPdf API, we're only using the Acm API): https://gist.github.com/justingarrick/5910539
eo_support
Posted: Tuesday, July 2, 2013 12:31:52 PM
Rank: Administration
Groups: Administration

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

There is no way for you to that with ACM interface. What you can do is, run an AcmRender with each question on a blank page first to measure the height of the whole question, then use that information to determine whether you should explicitly add an AcmPageBreak.

You would not be able to render particular AcmText as HTML. But again both the HTML to PDF and ACM interface allows you to start from any position on a page, and both can return the height of a given block to you. So you can use that information to mix them together.

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.