You have to scale the image according to the dpi. See the tutorial.



From: [EMAIL PROTECTED] on behalf of Booth, Brandon
Sent: Mon 13-Dec-04 20:44
To: '[EMAIL PROTECTED]'
Subject: [iText-questions] JPEGs added to document are oddly big

I'm adding JPEG images to a Document (one per page), like this:

 

         Document document = new Document();

 

         OutputStream outputStream = new FileOutputStream(outputFile);

 

         PdfWriter.getInstance(document, outputStream);

 

         document.open();

 

         for (int i = 1; i < args.length; i++)

         {

            String inputFile = args[i];

 

            Image jpg = Image.getInstance(inputFile);

 

            if(i > 1)

            {

               document.newPage();

            }

 

            document.add(jpg);

         }

 

         document.close();

 

This is essentially the tutorial example. The output pdf file

is created as expected. When I load the output file into

acrobat and set the zoom to 100% or use View\Actual Size

I'm expecting to see the images at their original size. Instead

They are larger than expected. If I set the zoom to 75% the

Images are the original size. Is their a setting on Document

or Image I can use to get the behavior I'd prefer?

 

Thanks

Brandon

Reply via email to