Michael Kottmann wrote:
> What I'm trying to do
> is create a pdf which takes fragmented html text from
> a DB and outputs it into groups.
OK.
> I initially tried to use the
> ColumnText, but I wasn't sure what to set the size to
> because I don't know how big each of the lists are
> going to be.
I don't understand: the beauty of ColumnText is that
you don't need to know the size. You should call go()
and if there's more text left, you go to another
column/page.
> I then tried to do something like:
>
> ArrayList p = HTMLWorker.parseToList(stringReader,
> null);
> for (int k = 0; k < p.size(); ++k)
> document.add((Element)p.get(k));
>
> The problem that I'm having with the above is that the
> lines will write over each other until it reaches an
> html list (ordered or unordered).
That's because the current leading is 0.
If you add a paragraph with a certain leading to the
document, and then do the document.add() invocations,
there will be space between the lines.
There are different ways to achieve the same result,
but I don't know which one would be best in your case.
Maybe this would help:
StyleSheet styles = new StyleSheet();
styles.loadTagStyle("b", "leading", "12,0");
Give it a try.
Another possible solution, is to add all the elements
in ArrayList p to a Paragraph object, the add this
Paragraph to the document.
br,
Bruno
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions