[ 
https://issues.apache.org/jira/browse/FOP-2972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18068166#comment-18068166
 ] 

Petter Reinholdtsen commented on FOP-2972:
------------------------------------------

I guess it boils down to a question of expectations.  I expect docbook+fop to 
behave as described by the official docbook describes and handle the official 
examples as described in <URL: 
[https://web.archive.org/web/20250513011349/http://www.sagehill.net/docbookxsl/SVGimages.html]
 > (using the Internet archive edition as I was unable to reach the original 
site), which is also the way both dblatex and HTML rendering work.

If you do not have such expectation, but is happy with the way fop work, then I 
guess it is simply not usable for docbook rendering in my use case, for 
typesetting books.

> Incorrectly trim edges of svg figure when using 'auto'
> ------------------------------------------------------
>
>                 Key: FOP-2972
>                 URL: https://issues.apache.org/jira/browse/FOP-2972
>             Project: FOP
>          Issue Type: Bug
>          Components: image/svg
>    Affects Versions: 2.3
>         Environment: Debian Buster
>            Reporter: Petter Reinholdtsen
>            Assignee: Joao Goncalves
>            Priority: Major
>              Labels: Debian
>         Attachments: circles.svg, table14.pdf
>
>
> When using docbook to create a document with a SVG figure, the figure left 
> and right edges are clipped.  The following script demonstrate the problem.  
> This problem was first reported to the docbook xslt project as issue #212.
>  ```
>  #!/bin/sh
> cat > circles.svg <<EOF
>  <?xml version="1.0"?>
>  <!-- from [http://www.sagehill.net/docbookxsl/SVGimages.html] -->
>  <svg xmlns="http://www.w3.org/2000/svg"; width="12cm" height="12cm">
>  <g style="fill-opacity:0.7; stroke:black; stroke-width:0.1cm;">
>  <circle cx="6cm" cy="2cm" r="100" style="fill:red;"
>  transform="translate(0,50)" />
>  <circle cx="6cm" cy="2cm" r="100" style="fill:blue;"
>  transform="translate(70,150)" />
>  <circle cx="6cm" cy="2cm" r="100" style="fill:green;"
>  transform="translate(-70,150)"/>
>  </g>
>  </svg>
>  EOF
> cat > test.xml <<EOF
>  <?xml version='1.0' encoding='UTF-8' ?>
>  <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
>  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd";>
>  <book lang="en">
>  <title>...</title>
>  <chapter>
>  <title>...</title>
>  <para>...</para>
>  <figure id="figure">
>  <title>A set of circles, should be perfectly round</title>
>  <mediaobject>
>  <imageobject>
>  <imagedata fileref="circles.svg"/>
>  </imageobject>
>  <textobject>
>  <phrase>With fop the left and right edges are flat</phrase>
>  </textobject>
>  </mediaobject>
>  </figure>
>  </chapter>
>  </book>
>  EOF
> xsltproc --output test.fo 
> /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl test.xml
>  fop -fo test.fo -pdf test.pdf
>  ```
>   
> See the docbook bug report above for an example rendering with the flat edges 
> of the circles.
> The relevant FO output look like this:
>  ```
> <fo:block id="d0e12">
>   <fo:external-graphic src="url(circles.svg)"
>       width="auto" 
>       height="auto"
>       content-width="auto"
>       content-height="auto" />
> </fo:block>
> ```



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to