Hi,

When i try to insert an image into a pdf it's getting stretched , how do i
avoid id ?
Here's my code , i have attached the sample png image too , please do help
me out .


      com.lowagie.text.Document document = new com.lowagie.text.Document();
      try {
            PdfWriter.getInstance(document, new FileOutputStream("c:
\\temp\\test1.pdf"));



            document.open();
            com.lowagie.text.Image png = com.lowagie.text.Image.getInstance
("c:\\temp\\test.png");
            document.add(png);
      } catch (DocumentException de) {
            System.err.println(de.getMessage());
      } catch (IOException ioe) {
            System.err.println(ioe.getMessage());
      }
      document.close();

(See attached file: test.png)
regards

Debasish Sahu.
Senior Software Engineer
RMS India.
A-7,Sector-16
Noida-201301.
Uttar Pradesh.India.
Phone :  +91-118-4511102
Fax :  +91-118-4511109
Website : http://www.rmsinet.com

Attachment: test.png
Description: PNG image

Reply via email to