On Oct 12, 2009, at 3:00 PM, mister bean wrote:


If you're trying to locate paragraphs exactly and keep the content together, tables or whatever you might mean by nested paragraphs are not the right way
to do it.

Use ColumnText, which allows you to place text anywhere and has specific provisions for keeping lines together. This is discussed in Chapter 7 of the
book.

If you mean something else by nested paragraphs, please explain what you
mean.

---mr. bean

It is for resume output.  So given the following:

Arbitrary text content as a paragraph

Arbitrary text content as a paragraph

Section 1 Title
------------------------------
      Section Entry 1 Title
Section Entry 1 Description with multiple, unknown number of lines of text

      Section Entry 2 Title
Section Entry 2 Description with multiple, unknown number of lines of text

      Section Entry 3 Title
Section Entry 3 Description with multiple, unknown number of lines of text

Section 2 Title
------------------------------
      Section Entry 1 Title
Section Entry 1 Description with multiple, unknown number of lines of text

      Section Entry 2 Title
Section Entry 2 Description with multiple, unknown number of lines of text

      Section Entry 3 Title
Section Entry 3 Description with multiple, unknown number of lines of text

Follow the rules:

- Arbitrary paragraph content can break anywhere
- No part of any section entry can break across pages
- If the first entry of a section would not print on the same page as the section title block, then break before the section title block.

The tricky part is the last rule. I am currently creating each section title as its own paragraph. Then the first section entry is being added as a child paragraph. The remaining section entries are added as independent paragraphs on their own. This all works well until the indentation comes in, the first section entry is not indented.

The problem I see with ColumnText is that it requires coordinates. I'm dealing with arbitrary text and don't have any coordinates. Depending on the arbitrary text before the section, the column could start anywhere on the page. Any ideas?

Thanks a ton for chiming in, Mr. Bean!

-Mike
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to