On Tue, Oct 26, 2010 at 11:30 AM, BM <[email protected]> wrote:
> 1. Create a columnset from MultiColumnText.
> 2. columnset.addElement(Paragraph) few times.
> 3. columnset.nextColumn() <--- This should move insertion point to the
> next column, right?
> 4. columnset.addElement(Image);
Update:
1. columnset = MultiColumnText
2. columnset.addElement(Paragraph) few times
3. document.add(columnset) <-- that makes text happen stick to the
first column, as expected.
4. columnset.nextColumn()
5. columnset.addElement(Image)
6. document.add(columnset)
Now I got new page break before Image, so my Image on the next page
for some weird reasons. :-( Source code of MultiColumnText says this:
-----------------8<--------------
public void nextColumn() throws DocumentException {
currentColumn = (currentColumn + 1) % columnDefs.size();
top = nextY;
if (currentColumn == 0) {
newPage();
}
}
-----------------8<--------------
Uhmm... Why would columnDefs.size() shift it to 0 (i.e. next page?).
So I issued "shiftCurrentColumn()" instead. And Image ended up on a
next column, however vertically shifted to the exact level, where text
finished on the first column, i.e. with some whitespace that is exact
tall as text in previous column. OK, the question is: how to reset Y
offset on the next column to get new object at a top?
--
Kind regards, BM
Things, that are stupid at the beginning, rarely ends up wisely.
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php