hello,
we used ColumnText as suggested by you we are able to get the
vertical position when we use it for a single page with no columns. But as
we use ColumnText further for a page having two or more column we are not
getting the vertical position. kindly tell us how to do it for a page
containing two or more column.
Like in this code I am getting Yline-
code 1-
PdfContentByte cb = writer.getDirectContent();
ColumnText ct = new ColumnText(cb);
BufferedReader reader =
new BufferedReader(new FileReader("caesar.txt"));
String line;
Create ColumnText object
while ((line = reader.readLine()) != null) {
ct.addText(new Phrase(line + "\n"));
}
reader.close();
ct.setSimpleColumn(36, 36,
PageSize.A4.width() - 36, PageSize.A4.height() - 36
18, Element.ALIGN_JUSTIFIED);
int status = ColumnText.START_COLUMN;
while (ColumnText.hasMoreText(status)) {
status = ct.go();
ct.setYLine(PageSize.A4.height() - 36);
document.newPage();
}
But now I have to add more than 1 column like-
code-2
float[] left = { 36, (PageSize.A4.width() / 2) + 18 };
float[] right = { (PageSize.A4.width() / 2) - 18,PageSize.A4.width() - 36 };
int status = ColumnText.NO_MORE_COLUMN;
int column = 0;
while (ColumnText.hasMoreText(status)) {
ct.setSimpleColumn(left[column], 36,
right[column], PageSize.A4.height() - 36);
status = ct.go();
}
in the code-2 how can I split the text in second column?
Thank You.
--
View this message in context:
http://old.nabble.com/how-to-use-ColumnText-tp27902576p27902576.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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/