o.a.f.i.loader.batik.PreloaderSVG - Error while trying to load stream as an SVG file: Invalid byte 1 of 1-byte UTF-8 sequence.

2016-03-08 Thread Bram Maes
Image is not rendering in pdf.  In the logs this is what I see:



11:57:24.293 DEBUG o.a.x.i.l.i.AbstractImageSessionContext - Creating new
Source for images/logo_nl.png
11:57:24.307 DEBUG o.a.f.i.loader.batik.PreloaderSVG - Error while trying
to load stream as an SVG file: Invalid byte 1 of 1-byte UTF-8 sequence.
11:57:24.311 DEBUG o.a.x.i.l.i.AbstractImageSessionContext - Returning
Source for images/logo_nl.png
11:57:24.313 DEBUG org.apache.fop.fo.FONode - Invalid element:
fo:external-graphic inside foreign xml markup


Seems like ImageLoaderFactory were loaded correctly:

11:57:14.310 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.fop.image.loader.batik.PreloaderWMF with priority 1000
11:57:14.311 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.fop.image.loader.batik.PreloaderSVG with priority 1000
11:57:14.311 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.PreloaderTIFF with priority 1000
11:57:14.311 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.PreloaderGIF with priority 1000
11:57:14.311 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.PreloaderJPEG with priority 1000
11:57:14.311 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.PreloaderBMP with priority 1000
11:57:14.311 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.PreloaderEMF with priority 1000
11:57:14.312 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.PreloaderEPS with priority 1000
11:57:14.312 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.PreloaderImageIO with
priority 2000
11:57:14.312 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.PreloaderRawPNG with priority 2000
11:57:14.486 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.fop.image.loader.batik.ImageLoaderFactorySVG: MIME =
image/svg+xml, Flavor = text/xml;DOM;namespace=http://www.w3.org/2000/svg
11:57:14.486 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.fop.image.loader.batik.ImageLoaderFactoryWMF: MIME =
image/x-wmf, Flavor = WMFRecordStore
11:57:14.540 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/vnd.wap.wbmp, Flavor = RenderedImage
11:57:14.541 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/vnd.wap.wbmp, Flavor = BufferedImage
11:57:14.541 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/png, Flavor = RenderedImage
11:57:14.541 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/png, Flavor = BufferedImage
11:57:14.541 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/x-png, Flavor = RenderedImage
11:57:14.541 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/x-png, Flavor = BufferedImage
11:57:14.542 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/jpeg, Flavor = RenderedImage
11:57:14.542 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/jpeg, Flavor = BufferedImage
11:57:14.542 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/bmp, Flavor = RenderedImage
11:57:14.542 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/bmp, Flavor = BufferedImage
11:57:14.542 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/gif, Flavor = RenderedImage
11:57:14.542 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.imageio.ImageLoaderFactoryImageIO:
MIME = image/gif, Flavor = BufferedImage
11:57:14.543 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryRaw: MIME =
image/png, Flavor = image/png;Raw
11:57:14.543 DEBUG o.a.x.i.loader.spi.ImageImplRegistry - Registered
org.apache.xmlgraphics.image.loader.impl.ImageLoaderFactoryRaw: MIME =
image/jpeg, Flavor = image/jpeg;Raw
11:57:14.5

Include XSL-FO stored in DB

2016-03-15 Thread Bram Maes
Hi,

In a service application I am generating XSL-FO's in the DB.  Translations
are also stored in the database and replaced via groovy templating.

I was wondering if it is possible to reuse some functions that one would
normally store in a seperate xsl file and include via an import.  Is there
any way to add functions to the fop 'context' so they would be available
for transformations and still be reusable for other xsl's as well (as these
generic function stylesheets would be stored in the DB as well)?

Thanks for your thoughts,
Kind regards,
Bram.