On Monday 14 May 2007, Thomas Bickel wrote:
> isn't it the other way round? 1px = .75pt?
Yes, you are right of course.

> So I was correct and the rtf image resolution is 33% higher than the
> document resolution. :) This is a bit annoying though because it differs
> from the way the pdf writer works (where the above code sample works as
> intended) and because none of the methods actually specify the units that
> are used.
>
> The scaling is still broken however.
> Check out the following example: Scaling to 99.99% in iText causes the
> image to be scaled to 130% in Word while scaling to 75% causes it to be
> scaled to 100%. This would work if the twips value
> (RtfElement.TWIPS_FACTOR) used to convert image pixels to twips
> (\picwgoal,\pichgoal) was set to 15.
Yes you are correct. Sorry for being a bit slow on the uptake :-). I hadn't 
run the example with the PdfWriter to see what it looks like there.

The problem is that the RtfWriter2 applies different metrics depending on 
whether you scale the image or not. An unscaled image is added at the native 
resolution employed by the RTF viewer (96dpi instead of the PDF 72dpi), while 
for scaled images the behaviour of the PdfWriter is imitated (72dpi).

The question now is which way to change the RtfImage class. Should it always 
generate 96dpi native images, which means that the user will have to manually 
adjust it down to 72dpi for PDF equality. The other option is always scaling 
images to 72dpi, with the side-effect that all unscaled images in Word say 
that they are at a scale of 133%.
I think that the second solution is better, due to the improved consistency 
between PDF and RTF, but I'm interested in other people's input here.

Greetings,
Mark
-- 
Q:      What do you say to a New Yorker with a job?
A:      Big Mac, fries and a Coke, please!

My GPG public key is available at:
http://www.edu.uni-klu.ac.at/~mhall/data/security/MarkHall.asc

Attachment: pgpRvCDij5lHW.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to