I do not see where you are defining image size. I believe in this case
dimensions of the original image is being used. However, if either width or
height is greater than the page size document.add() may be causing it to
rescale to fit. Why don t you try scaling to your defined values? If that is
not what you want then please explain further what the problem is.

Best

2010/12/14 José Luis Pino Moreno <[email protected]>

> Hi, i'm new with this library, so i hope that you could help me, i use the
> next code to create a simple PDF doc that contains only an image that i have
> with an specific size, but when I print the doc, the image size is
> differente than the size that i have predefined, and i can´t understand
> why?, can you help me please?
>
>
> import com.itextpdf.text.Document;
> import com.itextpdf.text.Image;
> import com.itextpdf.text.pdf.PdfWriter;
>
> import java.io.FileOutputStream;
>
> public class ImageExample {
>   public static void main(String[] args) {
>     Document document = new Document();
>
>     try {
>         PdfWriter.getInstance(document,
>                 new
> FileOutputStream("C:\\Users\\Pepe\\Desktop\\Image.pdf"));
>         document.open();
>
>         Image image1 =
> Image.getInstance("C:\\Users\\Pepe\\Desktop\\rfc.jpg");
>         //image1.get
>         document.add(image1);
>         document.close();
>     } catch(Exception e){
>       e.printStackTrace();
>     }
>   }
> }
>
> Thanks
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> 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
>



-- 
Nurettin DAG
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
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

Reply via email to