PdfPCell pdfPCell = new PdfPCell(img, true);

Will fit the image to the cell.

----- Original Message ----- 
From: "Sudheendra Singh" <[EMAIL PROTECTED]>
To: "Bart Allen" <[EMAIL PROTECTED]>
Cc: "Paulo Soares" <[EMAIL PROTECTED]>; "ITEXT"
<[EMAIL PROTECTED]>; "Steve Appling"
<[EMAIL PROTECTED]>
Sent: Saturday, November 20, 2004 1:43
Subject: RE: [iText-questions] Issue with Image into PDF


Hi,
 The formula does not work as the cell height and width is always 0.
Here is what I am doing
Image img = Image.getInstance("xyz.jpg");

PdfPCell pdfPCell = new PdfPCell(img);

img.scalePercent(24);

This works for any value 24 and below. Values 25 and above give a blank
cell. This happens for images whose width is greater than height.

In case of images whose height is greater than width, it can scale to 100%.

Any idea why it isupto 24% only.



Regards,
Sudheendra.N.Singh
Caritor Inc., CA
Cell : 415-760-1805
Work : 415-243-6903
Home : 510-675-0630

Pick battles big enough to matter not small enough to win.



-----Bart Allen <[EMAIL PROTECTED]> wrote: -----

To: Sudheendra Singh <[EMAIL PROTECTED]>
From: Bart Allen <[EMAIL PROTECTED]>
Date: 11/19/2004 06:49AM
cc: Paulo Soares <[EMAIL PROTECTED]>, ITEXT
<[EMAIL PROTECTED]>
Subject: RE: [iText-questions] Issue with Image into PDF

I use this to make it so the image always fits properly, regardless of
height width ratio.

if((cellHeight/imageHeight) < (cellWidth/imageWidth)){
    adjHeight = cellHeight;
adjWidth = imageWidth*(cellHeight/imageHeight);
}
else{
    adjHeight = imageHeight*(cellWidth/imageWidth);
adjWidth = cellWidth;
}
image.scaleAbsolute(adjWidth, adjHeight);


On Thu, 2004-11-18 at 15:31, Sudheendra Singh wrote:
  I am using PDFPCell and the issue seems to have resolved. But for an image
whose width is greater than height, I need to use the method
Image.scalePercent with a maximum value of 24 for the image to be displayed
in the PDFPCell of the PDFPTable.

  If I give any value above 24 (including 25), the image is not displaed on
the PDF.

  Is this value of 24 a agreed upon set value or is it a limitation ?

  Regards,
  Sudheendra.N.Singh
  Caritor Inc., CA
  Cell : 415-760-1805
  Work : 415-243-6903
  Home : 510-675-0630

  Pick battles big enough to matter not small enough to win.


  -----"Paulo Soares" <[EMAIL PROTECTED]> wrote: -----

  To: "Sudheendra Singh" <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]>
  From: "Paulo Soares" <[EMAIL PROTECTED]>
  Date: 11/18/2004 02:49AM
  Subject: RE: [iText-questions] Issue with Image into PDF

  That's a Table bug. Use PdfPTable.

----------------------------------------------------------------------------
    From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sudheendra
Singh
    Sent: Wednesday, November 17, 2004 11:16 PM
    To: [EMAIL PROTECTED]
    Subject: [iText-questions] Issue with Image into PDF


    Hi All,
       I am working on a module where we insert images into a PDF. It was
working fine but with one particular image (width-732 and height-1714) is
going into an infinite loop. I am using Table and Cell classes to achieve
this.
    Is there any restriction on the dimensions of the image that can be
rendered?

    Regards,
    Sudheendra.N.Singh
    Caritor Inc., CA
    Cell : 415-760-1805
    Work : 415-243-6903
    Home : 510-675-0630

    Pick battles big enough to matter not small enough to win.

    ------------------------------------------------------- This SF.Net
email is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A
multidimensional database that combines robust object and relational
technologies, making it a perfect match for Java, C++,COM, XML, ODBC and
JDBC. www.intersystems.com/match8
_______________________________________________ iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

  ------------------------------------------------------- This SF.Net email
is sponsored by: InterSystems CACHE FREE OODBMS DOWNLOAD - A
multidimensional database that combines robust object and relational
technologies, making it a perfect match for Java, C++,COM, XML, ODBC and
JDBC. www.intersystems.com/match8
_______________________________________________ iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions
=



-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to