My math works perfectly fine when I do not set UserUnit.  

The 200 is a default in case the TIF does not have this set, as it
should, it may be irrelevant.

    float iWidth =
        (float) ( (aImg.scaledWidth() /
                   ( ( (aImg.getDpiX() == 0) ? 200 : aImg.getDpiX())))
                 * 72);
    float iHeight =
        (float) ( (aImg.scaledHeight() /
                   ( ( (aImg.getDpiY() == 0) ? 200 : aImg.getDpiY())))
                 * 72);

              nDocument = new Document(new Rectangle(iWidth, iHeight),
                                       0, // left
                                       0, // right
                                       0, // top
                                       0); // bottom
              nPdfWriter =
                  PdfWriter.getInstance(nDocument,
                                        new FileOutputStream(nPdfFile));

              // nPdfWriter.setUserunit(( (img.getDpiX() == 0) ? 200 :
img.getDpiX()));

                aImg.scaleToFit(iWidth, iHeight);
                  nDocument.add(aImg);

So this has been working until I ran across an image that was bigger
than 200 inches.

Does this help you to understand my dilemma?

Thanks again in advanced.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Bruno Lowagie (iText)
Sent: Wednesday, April 11, 2007 8:22 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] What is the maximum page size for PDF
iniText?

Estepp, Dan wrote:
> The TIF image is 44x34.

I'm sorry, I think you missed the irony of my answer.
The page size given by Adobe Reader was CORRECT.
The page size you expected was WRONG.
The reason: you used a division instead of a multiplication.
Please redo your math.

By the way: the code snippet you show doesn't make sense to me. I have
no idea why you are fixated on a user value of 200.
Maybe you should read the user unit explanation once more.

br,
Bruno

------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT Join
SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to