I have attached Server Logs for both.

For each, the Server was restarted anew beforehand.

To make them better comparable, I've redacted them as follows:
- Timestamps removed from beginning of lines
- blank lines inserted where differences occur
- Pretty-Printed the generated FO as XML

There are Log-entries from our Resource-Resolver for the external-graphic,
but it simply delegates SVG's to the apache FOP DefaultResourceResolver.

Looks to me as though both are generating an SVG?

All the best,

On 29/01/2022 06:16, xmlgraphics.d...@apconsult.de wrote:
Hi Matt,

we have a Stone Age Linux, but the rest is fairly up-to-date:

SUSE Linux Enterprise Server 11.1 (x86_64)

openjdkversion "17" 2021-09-14
OpenJDKRuntime Environment (build 17+35-2724)
OpenJDK64-Bit Server VM (build 17+35-2724, mixed mode, sharing)

Apache FOP v2.6

As suggested on
I did start the server with...
...without really knowing what that does, but it made no difference.

I wonder whether the headless remarks are historical in nature
& not relevant for current Batik releases?
(we are using the current Batik v1.14)

I also went to great lengths to reproduce the exact same Classpath order under Windows, defining each Library individually & using a comparable JDK with Eclipse 2021-09:
openjdkversion "17.0.1" 2021-10-19 LTS
OpenJDKRuntime Environment Zulu17.30+15-CA (build 17.0.1+12-LTS)
OpenJDK64-Bit Server VM Zulu17.30+15-CA (build 17.0.1+12-LTS, mixed mode, sharing)

What doesn't make sense to me is how FOP managed to render the external SVG
but inlining it, the SVG Graphic was not rendered.
(from the trace it looked like it was doing some SVG rendering)

Surely, if it can render an external SVG, it must be able to render an inline one?!

All the best,

On 28/01/2022 14:04, Matt Kynaston wrote:
We render inline SVGs on linux (RHEL7 atm) all the time, without needing to install anything special - although it does pull in a "headless" version of openjdk.

Which linux? Which java? Which version of FOP?


On Sun, 23 Jan 2022 at 14:01, <xmlgraphics.d...@apconsult.de> wrote:

    Hi there,

    we are using Apache FOP to generate PDF's & have an issue with SVG's.

    To include an SVG we're using something like the following...

    |<fo:block> <fo:external-graphic
    src="classpath:image/MyImage.svg" content-width="150mm"/>
    </fo:block> |

    The above works fine in all environments.

    Now I'm trying to inline an SVG in the Stylesheet, like this...

    |<fo:block> <fo:instream-foreign-object content-width="272.6mm">
    <svg xmlns="http://www.w3.org/2000/svg";
    <http://www.w3.org/2000/svg> width="780" height="120" viewBox="0
    0 780 120"> <g
    style="fill-opacity:0;stroke-width:2;stroke:black"> <rect x="2"
    y="2" width="254" height="99"/> <rect x="256" y="2" width="485"
    height="99"/> </g> </svg> </fo:instream-foreign-object> </fo:block> |

    That works OK under Windows, but when deployed on our Linux
    Server, seems to do nothing.

    I have read some comments on the Apache FOP Website about it
    using Apache Batik to render SVG's
    and that this requires a Graphical Environment, so will not work
    in many Unix configurations.

    What I don't understand is, how come the external SVG is working
    ok on the Unix Server & inline is not?

    Also, the Apache FOP Website recommends a Tool called PJA toolkit
    <https://www.eteks.com/pja/en/> to workaround this issue,
    but it looks very dated, so I wonder if its going to work with
    our JDK 17?
    (and indeed its developer, Emmanuel Puybaret, is quite surprised
    anyone would still be recommending use of this tool)

    I would be grateful if anyone has some Info about this.

    All the best,


Matt Kynaston
Lead Developer
Tel: +441225851666
www.claritum.com <http://www.claritum.com>

Claritum Limited. Registered Office: 37 Great Pulteney Street, Bath, BA2 4DA  Registered in England and Wales 3878694

Attachment: svg_DEBUG_external-graphic.txt
Description: application/unknown-content-type

Attachment: svg_DEBUG_instream-foreign-object.txt
Description: application/unknown-content-type

To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org

Reply via email to