Hi all,
I'm in the process of upgrading to iText 2.1.7 but the setFixedHeight
method of PdfCell doesn't work like it did in iText 1.4.6.
The following is an example of code that I used in 2.1.7 (for 1.4.6
change getScaledHeight() to scaledHeight()) that illustrates that it
displays the image a lot larger than it did in 1.4.6. The code has
been written this way so an image can be centred on the page.
Document document = .......;
PdfPTable table = new PdfPTable(1);
Image image = Image.getInstance("image.jpg");
PdfPCell cell = new PdfPCell();
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setFixedHeight(image.getScaledHeight());
cell.setImage(image);
table.addCell(cell);
document.add(table);
document.add(new Paragraph("table height is " + table.getTotalHeight()));
For an image that is 144 pixels high the table height output is 418.4
in iText 2.1.7, but in iText 1.4.6 it is 144.0.
Any ideas why this has changed and how I can change my code so that
the image is created at the same size as iText 1.4.6?
thanks,
Carmen
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php