Thanks, Hussein.
Yes, I subsequently found that an absolute measurement (e.g. @width=160mm)
works better.

However, the size of unscaled images differs in the docx and the PDF -
presumably a resolution issue, I'll try 120dpi. As it happens, it is docx
format that I want, and I can always write docx to PDF.

The reason I tried pixels rather than millimetres, was that in the XHTML,
160mm was interpreted as 160px (as indicated in the Image Info - this is in
Firefox). Since the screenshots in XHTML might as well be original size,
I've commented out the call to imageSizeAttributes in the transform (bit
naughty).

/Roy

-----Original Message-----
From: Hussein Shafie [mailto:[email protected]]
Sent: 01 September 2010 13:02
To: Roy MacLean
Cc: [email protected]
Subject: Re: [XXE] Image sizing problem with FOP


Roy MacLean wrote:
>
> I have just upgraded to XXE Pro, and got it talking to XDR - fantastique!
> Consequently, I am trying out the DITA Conversion from within XXE, as I
can
> do this directly on files (maps, topics) in XDR.
> Up to now, I have been running ditac from a command prompt (bat file), and
> incidentally using a free-standing FOP 0.95 installation (downloaded
> November 09).
>
> In a User Guide I am currently writing, I have screenshots (as PNGs),
which
> are, say, 30cm wide.
> In the DITA topics, the image elements have @width=600px, which at 96dpi
> scales them to about 16cm.

I'm not sure it can be computed this way.

[1] How does FOP convert pixels (px) to an absolute size. Is it really
by considering that 1 inch contains 96 pixels?

[2] FOP takes into account the image resolution if found in the image
file. Therefore may be the resulting size depends on the software which
has created the image file.



> Processing these with ditac + the stand-alone FOP, these resize correctly.
> However, processing these from within XXE - that is, using the XXE
embedded
> FOP, no scaling takes place, and the images appear at original size (and
> thus run way off the right side of the page).
> The FO file is correct, in that the width attribute is there (and so the
> conversion to docx works fine - of course).
>
> As far as I can tell the FOPs are the same version (0.95); however, the
> stand-alone one uses Xalan, and the XXE one uses Saxon.
> Could this be the difference?

No.

* ditac uses free-standing FOP, but *not* its Xalan component. Like XXE,
ditac always uses Saxon to transform XML files.

* By default, The FOP plug-in for XXE uses a 120dpi default image
resolution. The free-standing FOP uses 72dpi.



> Any other ideas?

No.



> Anyone else found this problem?

With XEP and XFC invoked by XXE, @width=600px reduces the size of a
large screenshot (1440x840 created by xv, which does not seem to add
resolution info to PNG files) in the PDF/ODT to approximately 15cm.

With FOP invoked by XXE, @width=600px (or @width=600) does *not* seem to
reduce the size of a large screenshot in the PDF. However @width=16cm
works fine.

With FOP invoked by ditac, @width=600px reduces the size of a large
screenshot in the PDF/ODT to approximately 25cm (which is much too large).

Therefore, the different default image resolutions (120dpi versus 72dpi)
seem to explain what happens. Second, specifying @width=16cm seems to
give more consistent results than specifying @width=600px.






=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.18, Virus/Spyware Database: 6.15780)
http://www.pctools.com/
=======





=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.18, Virus/Spyware Database: 6.15780)
http://www.pctools.com/
=======
 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to