The maximum page size is 14400x14400. This is a PDF implementation limit.

----- Original Message ----- 
From: "Alex Greif" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, August 03, 2005 8:47 AM
Subject: [iText-questions] large image problem


Hi,
my problem is the following:
I have a picture in 72 dpi (width=2560px height=1920px) and want to
create a scaled result that is larger than the original image and uses
interpollation.
the original image has a width/height ratio of 4/3, and the PDF
document should have the same size as the resulting image
I use the following code:

// this will be the resulting size
float width = 20670f;
float height = width * 3/4;
Rectangle pageSize = new Rectangle(width, height);
Document document = new Document(pageSize);
document.setMargins(0, 0, 0, 0);
PdfWriter.getInstance(document, response.getOutputStream());
document.open();
byte[] origContent = IOUtil.getBytesFromFile(pictureFile);
com.lowagie.text.Image image = Image.getInstance(origContent);
image.setInterpolation(true);
float ratio = width/image.width();
image.scaleAbsolute(width, image.height()*ratio);
document.add(image);
...

the scaling works fine for small images that will have a width of
5000px or 13000px but fails in this case with 21000px.
the java code finishes without throwing any exceptions but the pdf
page is completely blank.
I know, scaling from 2560px to 21000px is not easy but in a further
process the pdf will be used to print a 300 dpi image.

is this a bug or some sort of overflow problem in the scaling algorithm?

Any help is appreciated.
Thanks,
Alex.


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to