Why does iText change the order of Elements, if an Image does not fit to the
rest of the page?
Example:
Document document = new Document();
try {
// step 2:
// we create a writer that listens to the document
// and directs a PDF-stream to a file
PdfWriter.getInstance(document, new
FileOutputStream("test.pdf"));
// step 3: we open the document
document.open();
// step 4: we create a table and add it to the document
Phrase p0 = new Phrase("This is image 0");
document.add(p0);
Image img0 = Image.getInstance("Image0.bmp");
document.add(img0);
Phrase p1 = new Phrase("This is image 1");
document.add(p1);
Image img1 = Image.getInstance("Image1.bmp");
document.add(img1);
Phrase p2 = new Phrase("This is image 2");
document.add(p2);
Image img2 = Image.getInstance("Image2.bmp");
document.add(img2);
Phrase p3 = new Phrase("This is image 3");
document.add(p3);
Image img3 = Image.getInstance("Image3.bmp");
document.add(img3);
Phrase p4 = new Phrase("This is image 4");
document.add(p4);
Image img4 = Image.getInstance("Image4.bmp");
document.add(img4);
Phrase p5 = new Phrase("This is image 5");
document.add(p5);
Image img5 = Image.getInstance("Image5.bmp");
document.add(img5);
}
catch(DocumentException de) {
System.err.println(de.getMessage());
}
catch(IOException ioe) {
System.err.println(ioe.getMessage());
}
// step 5: we close the document
document.close();
If Image0.bmp,Image1.bmp,Image3.bmp,Image4.bmp,Image5.bmp have the height of
2.33 inch (7 cm) and Image2.bmp 5.67 inch (17 cm), then the resulting pdf
presents the Elements in that order:
p0
img0
p1
img1
p2
p3
img3
<new page>
img2
p4
p5
<new page>
img4
img5
Is there another possibility to deal with that problem than to wrap every
Image into a Table?
kind regards
Klaus Fleischer
IZB SOFT - S52
* 0911/3269-344
* IZB SOFT - S�dwestpark 108 , 90449 N�rnberg
* [EMAIL PROTECTED]
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions