Hi all, In the following code I simply put an image in the document, and then in the next page I put the same image inside a PdfPCell, although I'm using jpg1.setWidthPercentage(0); why does the image inside PdfPCell result bigger than the other one?
Thanks, regards. Raffaele public static void main(String[] args) { System.out.println("Scaling an Image"); // step 1: creation of a document-object Document document = new Document(); try { // step 2: // we create a writer that listens to the document // and directs a PDF-stream to a file Format formatter = new SimpleDateFormat("yyyyMMddmmss"); String outputFileName = "scaling_" + formatter.format(new Date(System.currentTimeMillis())) + ".pdf"; PdfWriter.getInstance(document, new FileOutputStream("pdf/scaling/" + outputFileName)); // step 3: we open the document document.open(); // step 4: we add content String image = "images/otsoe.jpg"; Image jpg1 = Image.getInstance(image); document.add(new Paragraph("Original size --> (" + jpg1.getWidth() + ", " + jpg1.getHeight() + ")" )); document.add(jpg1); document.newPage(); PdfPTable pdfPTable = new PdfPTable(1); pdfPTable.addCell("Original size --> (" + jpg1.getWidth() + ", " + jpg1.getHeight() + ")"); jpg1.setWidthPercentage(0); pdfPTable.addCell(jpg1); document.add(pdfPTable); } catch(DocumentException de) { System.err.println(de.getMessage()); } catch(IOException ioe) { System.err.println(ioe.getMessage()); } // step 5: we close the document document.close(); } ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/