I've got the following problem. I just want to add a header into a Document. 
Therefore I create a PdfPTable with one PdfPCell. Before I can add the 
PdfPCell to the PdfPTable I get some different Paragraphs that I must add. The 
Paragraphs consists of different Phrases with different Chunks. In the Chunks 
can be some Images. 
My problem now is, that if I want to add Paragraph that consists of a Phrase 
with a Imagechunk and there was a line break in one of the Phrases before the 
Image overwrites the text in the lines before.
Any idea how I could resolve this problem. Or has someone any idea how I could 
change the programcode that I don't need to add Paragraphs into a PdfPCell.

Code:

PdfPTable table = new PdfPTable(1);

Chunk chunk1 = new Chunk("Test\n");
Phrase phrase1 = new Phrase();
phrase1.add(chunk1);

Image image1 = Image.getInstance("Test.gif");
Chunk chunk2 = new Chunk(image1, 0, 0);
Phrase phrase2 = new Phrase();
phrase2.add(chunk2);

Paragraph paragraph = new Paragraph();
paragraph.add(phrase1);
paragraph.add(phrase2);

PdfPCell cell = new PdfPCell();
cell.addElement(paragraph);

table.addCell(cell);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to