0

(code in itextsharp but question is to both itext and itext sharp)

I tried to use XMLWorkerHelper.GetInstance().ParseXHtml(mh, sr); to convert a richtext field to PDF. But it failed in converting nested lists.

    <ul>
        <li>
            test1
            <ul>
                <li>test1.1</li>
            </ul>
        </li>
        <li>test2</li>
    </ul>

is rendered as

  • test1 test1.1
  • test2

So I searched around and found this post

Then someone mention in the post above that nested list will not work for a ColumnText, which I need to use to fill text that can overflown to next page.

ct.AddElement(par);
int status = 0;
status = ct.Go();

if (ColumnText.HasMoreText(status))
{
    // add new page and continue filling columntext
}

I guess my question is besides ColumnText, what else that I can use which renders nested lists well that can deal with overflown richtext PDF field

Edit: we are using itextsharp 5.5.10. not sure if it is fixed in itext 7

Community
  • 1
  • 1
user1541389
  • 115
  • 2
  • 11
  • Found a log [link]http://itextpdf.com/changelog/556 and a jira number SUP-879 but not sure the status of it. If not using ColumnText, what can I use to generate pdf field that can overflown to next page – user1541389 Jan 12 '17 at 02:47
  • I'm just thinking if I can use columntext just as a way to measure the fit, then cut the element list with the ones that fits in the columntext. I know that I have the y position after columntext go, how can I cut the piece(element) that fits before y then use document to write instead of columntext – user1541389 Jan 12 '17 at 18:00

0 Answers0