You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Clay Leeds <cl...@medata.com> on 2004/08/25 23:55:39 UTC
Graphics in fo:region-end
BACKGROUND
I am creating a medical form and have 3 sections in my document. On the
right side of each section, there is a string of text, rotated
90-degrees explaining what that section contains.
This would be a nice excuse to use SVG if not for two reasons: 1) SVG
text is rendering poorly in my FOP output (Jaggies, which could be
font-related, though--I haven't had much need for SVG text yet); 2)
more importantly, Batik doesn't play nicely headless system, and this
project has the potential to run on a headless server.
Since SVG isn't working out, I decided to use Graphics, and herein lies
the problem.
PROBLEM
I have 3 graphics (each 35px wide w/ rotated red text w/ white margins)
in an fo:region-end and I have a strange problem: the TOP graphic
renders at slightly larger than the correct size; the MIDDLE graphic
renders correctly; the BOTTOM graphic renders smaller than the correct
size.
I've tried using every combination imaginable of width/height,
content-width/content-height, both ON, OFF, width + content-width, etc.
and nothing works. There isn't a problem with HEIGHT, because there is
ample space on either side of each image.
I was finally able to work around the problem by futzing with the width
of each image so the TOP is now 53x260 wide, MIDDLE is 36x1181, BOTTOM
is 32x1360.
ENVIRONMENT
- fop-0.20.5
- Java 1.4.2
- WinXP
I am actually satisfied with the workaround, but I wanted to report it
and wondered if anyone has an idea about why this is occurring?
Clay Leeds - cleeds@medata.com
--
Web Developer - Medata, Inc. - <http://www.medata.com/>
PGP Public Key: <https://mail.medata.com/pgp/cleeds.asc>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Graphics in fo:region-end
Posted by Clay Leeds <cl...@medata.com>.
ANOTHER UPDATE:
I got the results I was looking for, not by using fo:external-graphics,
but by placing the graphic in the @background-image for the
fo:table-cell. Unfortunately, the background-position* attributes
aren't working (the FOP Compliance page[1] does indicate 'yes' for
Basic support, but 'no' Extended support).
One frustration, I had to take my 'pretty' 300dpi JPG image and convert
it to 72dpi, because FOP appears to render my 300dpi image at 72dpi,
making the graphic larger than the space it occupies. The XSL-FO spec
does not indicate any sort of background-image 'scale' or
background-content-width attribute.
I hope this information helps someone!
Web Maestro Clay
[1] FOP Compliance Page - background-position-horizontal:
http://xml.apache.org/fop/compliance.html#fo-property-background-
position-horizontal
On Aug 26, 2004, at 8:45 AM, Clay Leeds wrote:
> UPDATE:
> I've noticed, that as I increase the fo:region-after @extent from
> 3.5cm to 4cm, the MIDDLE & BOTTOM images get smaller. There is no
> change to the size of the TOP image in either case.
>
> FWIW, the TOP and MIDDLE images are completely within the
> fo:region-before @extent (height); the BOTTOM image 'starts' in the
> fo:region-before @extent, and 'ends' in the fo:region-body portion.
>
> If this is confusing, I'll post something to bugzilla. I hesitate to
> call this a bug yet...
>
> Web Maestro Clay
>
> On Aug 25, 2004, at 2:55 PM, Clay Leeds wrote:
>> PROBLEM
>> I have 3 graphics (each 35px wide w/ rotated red text w/ white
>> margins) in an fo:region-end and I have a strange problem: the TOP
>> graphic renders at slightly larger than the correct size; the MIDDLE
>> graphic renders correctly; the BOTTOM graphic renders smaller than
>> the correct size.
>>
>> I've tried using every combination imaginable of width/height,
>> content-width/content-height, both ON, OFF, width + content-width,
>> etc. and nothing works. There isn't a problem with HEIGHT, because
>> there is ample space on either side of each image.
>>
>> I was finally able to work around the problem by futzing with the
>> width of each image so the TOP is now 53x260 wide, MIDDLE is 36x1181,
>> BOTTOM is 32x1360.
>
> <snip>
>
>> I am actually satisfied with the workaround, but I wanted to report
>> it and wondered if anyone has an idea about why this is occurring?
>>
>> Clay Leeds - cleeds@medata.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Graphics in fo:region-end
Posted by Clay Leeds <cl...@medata.com>.
UPDATE:
I've noticed, that as I increase the fo:region-after @extent from 3.5cm
to 4cm, the MIDDLE & BOTTOM images get smaller. There is no change to
the size of the TOP image in either case.
FWIW, the TOP and MIDDLE images are completely within the
fo:region-before @extent (height); the BOTTOM image 'starts' in the
fo:region-before @extent, and 'ends' in the fo:region-body portion.
If this is confusing, I'll post something to bugzilla. I hesitate to
call this a bug yet...
Web Maestro Clay
On Aug 25, 2004, at 2:55 PM, Clay Leeds wrote:
> PROBLEM
> I have 3 graphics (each 35px wide w/ rotated red text w/ white
> margins) in an fo:region-end and I have a strange problem: the TOP
> graphic renders at slightly larger than the correct size; the MIDDLE
> graphic renders correctly; the BOTTOM graphic renders smaller than the
> correct size.
>
> I've tried using every combination imaginable of width/height,
> content-width/content-height, both ON, OFF, width + content-width,
> etc. and nothing works. There isn't a problem with HEIGHT, because
> there is ample space on either side of each image.
>
> I was finally able to work around the problem by futzing with the
> width of each image so the TOP is now 53x260 wide, MIDDLE is 36x1181,
> BOTTOM is 32x1360.
<snip>
> I am actually satisfied with the workaround, but I wanted to report it
> and wondered if anyone has an idea about why this is occurring?
>
> Clay Leeds - cleeds@medata.com
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Graphics in fo:region-end
Posted by Clay Leeds <cl...@medata.com>.
On Aug 27, 2004, at 12:00 PM, J.Pietschmann wrote:
> Clay Leeds wrote:
>>>> headless system,
>> One of the systems we use is AIX, and we were unable to get the
>> workarounds to function.
>
> I'm successfully running an older Cocoon with updated FOP and Batik
> Jars on an AIX 5.3 headless, using th headless option for Java 1.4.
>
> A solution using PJA on AIX 4.3 ? IBM Java 1.3.1 was decommissioned
> two months ago. Granted, setting up PJA for running in WebSphere 3.5
> is a major PITA ...
>
> J.Pietschmann
As look would have it... One of my installations runs AIX 4.3 w IBM
Java 1.3.1... Hence my attempt at avoiding SVG in my app... Ahh well...
At least the images work fairly well...
Web Maestro Clay
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Graphics in fo:region-end
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Clay Leeds wrote:
>>> headless system,
> One of the systems we use is AIX, and we were unable to get the
> workarounds to function.
I'm successfully running an older Cocoon with updated FOP and Batik
Jars on an AIX 5.3 headless, using th headless option for Java 1.4.
A solution using PJA on AIX 4.3 ? IBM Java 1.3.1 was decommissioned
two months ago. Granted, setting up PJA for running in WebSphere 3.5
is a major PITA ...
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Graphics in fo:region-end
Posted by Clay Leeds <cl...@medata.com>.
On Aug 26, 2004, at 12:55 PM, J.Pietschmann wrote:
> Clay Leeds wrote:
>> This would be a nice excuse to use SVG if not for two reasons: 1) SVG
>> text is rendering poorly in my FOP output
>
> Did you try
> http://xml.apache.org/fop/faq.html#svg-text
erm... no. Thanks! I'll check it out!
>> 2) more importantly, Batik doesn't play nicely headless system, and
>> this project has the potential to run on a headless server.
>
> Hup? Doesn't
> http://xml.apache.org/fop/faq.html#svg-headless
> help?
One of the systems we use is AIX, and we were unable to get the
workarounds to function. I think the tip with "Xvfb" in it was the
closest we got, but we have problems we weren't able to resolve. We
weren't using SVG at all (so that wasn't an issue), and ended up using
outputting to Postscript instead of -print, and then cat'ing the
resulting file to a Postscript printer.
>> PROBLEM
>> I have 3 graphics (each 35px wide w/ rotated red text w/ white
>> margins) in an fo:region-end and I have a strange problem: the TOP
>> graphic renders at slightly larger than the correct size; the MIDDLE
>> graphic renders correctly; the BOTTOM graphic renders smaller than
>> the correct size.
> Maybe a problem with the scaling code. Or something else.
>
>> I've tried using every combination imaginable of width/height,
>
> For SVG, the heigth/width in the SVG itself should match, otherwise
> strange results may occur.
> You shouldn't use pixels as units of measure, which may be rounded
> in unexpected ways, use cm/in/pt instead.
>
>> content-width/content-height,
> No effect at all, these properties are never used in FOP for any
> purpose.
>
>> and nothing works. There isn't a problem with HEIGHT, because there
>> is ample space on either side of each image.
> The scaling code uses available height in the region *body*,
> unfortunately. This doesn't quite explain why the top image
> is rendered larger though, unless this is an artifact of the
> screen renderer (Acrobat).
>
> J.Pietschmann
Ahhh... This is what I was beginning to allude to in one of my
updates... The Acrobat artifact possibility is interesting. I was
looking at the PDF at ~150% (page-width)...
Thanks for the comments!
Web Maestro Clay
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Graphics in fo:region-end
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Clay Leeds wrote:
> This would be a nice excuse to use SVG if not for two reasons: 1) SVG
> text is rendering poorly in my FOP output
Did you try
http://xml.apache.org/fop/faq.html#svg-text
> 2) more
> importantly, Batik doesn't play nicely headless system, and this
> project has the potential to run on a headless server.
Hup? Doesn't
http://xml.apache.org/fop/faq.html#svg-headless
help?
> PROBLEM
> I have 3 graphics (each 35px wide w/ rotated red text w/ white margins)
> in an fo:region-end and I have a strange problem: the TOP graphic
> renders at slightly larger than the correct size; the MIDDLE graphic
> renders correctly; the BOTTOM graphic renders smaller than the correct
> size.
Maybe a problem with the scaling code. Or something else.
> I've tried using every combination imaginable of width/height,
For SVG, the heigth/width in the SVG itself should match, otherwise
strange results may occur.
You shouldn't use pixels as units of measure, which may be rounded
in unexpected ways, use cm/in/pt instead.
> content-width/content-height,
No effect at all, these properties are never used in FOP for any
purpose.
> and nothing works. There isn't a problem with HEIGHT, because there is
> ample space on either side of each image.
The scaling code uses available height in the region *body*,
unfortunately. This doesn't quite explain why the top image
is rendered larger though, unless this is an artifact of the
screen renderer (Acrobat).
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org