Title: Re: FOP inserting white space into SVG images
I have provided the sample output I'm getting at the following URL:
 
http://www.eng.utoledo.edu/~jcoutche/fop.pdf
 
Maybe "white space" wasn't the best description of the problem.  Take a look at the image in the PDF.  Now, look at the image size in the FO document (content-width, content-height, and viewBox):
 
                 <fo:instream-foreign-object content-width="180.8mm" content-height="30.0mm" background-color="red">
                     <svg:svg viewBox="0 0 180 30">
                         <svg:rect x="0" y="0" width="180" height="30" fill="none" stroke="black" />
                     </svg:svg>
                 </fo:instream-foreign-object>

As you will notice, the size I defined for it is rectangular, and not the square shape as FOP is rendering it as.
 
I have tried using instream-foreign-object and external-graphic (with content-width="180.8mm" content-height="30.0mm" background-color="red"), and I get the same results.  Yet, if I have a PNG file of the same dimensions, and use the exact same external-graphic element with the exact same parameters, it renders how it should.
 
This is the expected output:  http://eng.utoledo.edu/~jcoutche/fop2.pdf
 
The graphic I'm using needs to stay as an SVG, as I would rather it be embedded directly in the XML document.
 
Thanks!
 
Sincerely,
Joseph Coutcher


From: Manuel Mall [mailto:[EMAIL PROTECTED]
Sent: Wed 7/5/2006 11:36 AM
To: [email protected]
Subject: Re: FOP inserting white space into SVG images

On Wednesday 05 July 2006 22:36, Coutcher, Joseph James wrote:
> Hello everyone.  I'm having issues with rendering an
> instream-foreign-object in FOP 0.92beta.  No matter what properties I
> set, whether it be width, height, content-width or content-height,
> nothing will generate the required size for the image.  Basically,
> FOP is adding blank spacing to the image, and it will ignore some
> parameters.
>

What do you mean by adding white space to the image? Do you mean there
is some white space above and below the image (which can't be really
seen with your fo sample)? If that is your problem try and set the
property line-height="0" on the enclosing block. This will stop any
white space being created at the top and bottom (usually referred to as
the 'half-leading') of all lines within the block.

If this is not your problem, that is I misunderstood what your are
asking, please try again to explain your problem with respect to the
additional white space.

Manuel

> For example, if I set content-width="100%", content-height is
> ignored...and vice versa.  With the sample document below,
> content-width is completely ignored.  Try setting it to 50000mm, and
> you'll see what I mean.
>
> All I want to do is remove the "white space" from the image...as this
> really screws up the formatting of the document...and to get FOP to
> resize the image correctly.
>
> Any help would be greatly appreciated!  Thanks!
>
> Sincerely,
> Joseph Coutcher
>
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root initial-page-number="1" xmlns:fo="
> <http://www.w3.org/1999/XSL/Format>
> http://www.w3.org/1999/XSL/Format" xmlns:svg="
> <http://www.w3.org/2000/svg> http://www.w3.org/2000/svg">
> <fo:layout-master-set>
>         <fo:simple-page-master master-name="letter_landscape"
> page-height="8.5in" page-width="11in">
>             <fo:region-body margin-top="1in" margin-bottom="1in"
> margin-left="1in" margin-right="1in" />
>         </fo:simple-page-master>
>     </fo:layout-master-set>
>
>     <fo:page-sequence master-reference="letter_landscape">
>         <fo:flow flow-name="xsl-region-body">
>             <fo:block>
>                 <fo:instream-foreign-object content-width="180.8mm"
> content-height="30.0mm" background-color="red">
>                     <svg:svg viewBox="0 0 180 30">
>                         <svg:rect x="0" y="0" width="180" height="30"
> fill="none" stroke="black" />
>                     </svg:svg>
>                 </fo:instream-foreign-object>
>             </fo:block>
>         </fo:flow>
>     </fo:page-sequence>
> </fo:root>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to