> 1) I have created ColumnTexts and added the columntext objects to > the list as list items. But on doing so that text in the list items in > not justified. What is the way to have justified text in lists? > >> Aren't ListItem objects derived from Paragraph objects? >> Doesn't setting the alignment on the ListItem work?
Have a look at the following code (the data.txt is attached.) You will see
that in the output PDF document the text is not justified. {this example is
in iTextSharp}.
Document doc = new Document();
PdfWriter pw = PdfWriter.GetInstance(doc, new FileStream(@"..\..\test3.pdf",
FileMode.Create));
doc.Open();
string[] t = File.ReadAllLines(@"..\..\data.txt");
PdfContentByte cb = pw.DirectContent;
ColumnText ct = new ColumnText(cb);
ct.SetSimpleColumn(90, 300, 560, 820, 15, Element.ALIGN_JUSTIFIED);
List list = new List(true, 10);
foreach(string s in t)
{
ListItem l = new ListItem(s);
List.Add(l);
}
ct.AddElement(list);
ct.Go();
doc.Close();
You will see that the first line of each list item is not justified with the
rest of the lines. (I am also attaching the generated test3.pdf)
regards,
Abhishek.
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
test3.pdf
Description: Adobe PDF document
the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dogthe quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog the quick brown fox jumps over lazy dog
