hi i am using java to create a pdf file. I need to have a output like this:
t
h this is text 1
i this is text 2
s
i
s
h
t
t
That means there is a text outsite the table which show in vertical form. I write a code like this:
PdfWriter.getInstance(document, new FileOutputStream("check.pdf"));
document.open();
Font cellFont = FontFactory.getFont(FontFactory.TIMES_BOLD, 6, Font.BOLD);
PdfPTable table = new PdfPTable(8);
table.getDefaultCell().setBorder(1);
table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
PdfPCell cell = new PdfPCell(new Phrase("This is the text 1", cellFont));
cell.setColspan(8);
cell.setBorder(0);
cell.setHorizontalAlignment(3);
table.addCell(cell);
cell = new PdfPCell(new Phrase("This is the text 2", cellFont));
cell.setColspan(8);
cell.setBorder(0);
cell.setHorizontalAlignment(3);
table.addCell(cell);
document.add(table);
document.close ();
This output like this:
this is text 1
this is text 2
Can any one tell me how to modify this code to get my desired output
