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 Philipp Wagner <ph...@med.uni-muenchen.de> on 2007/08/14 10:08:22 UTC
using fo:external-graphic with a data:image/auto;base64 URI
Hello,
I am currently trying to convert WordML-documents to XSL-FO and then PDF
using the wordml2fo XSL Script by RenderX and Microsoft [1]. This
embeds images into the FO file like that:
<fo:external-graphic
src="url("data:image/auto;base64,H4sIAAAAcBZxWR==
")"/>
(shortened, no valid base64-string any more)
This seems to use a URI scheme described in RFC 2397 [2].
FOP 0.93 doesn't seem to support this URI scheme and this way of
embedding images. Is there another way of embedding (bitmap) images in
FOP or is there support planned for this URI scheme? I couldn't find
anything in the XSL-FO specs which says this scheme must be supported
or not, but some commercial FOP processors (at least RenderX's XEP, as
they prepared that XSL-Stylesheet I'm using) seem to support it.
Thanks!
Philipp
[1] see http://www.renderx.com/tools/freetools.html
[2] http://www.ietf.org/rfc/rfc2397.txt
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: using fo:external-graphic with a data:image/auto;base64 URI
Posted by Philipp Wagner <ph...@med.uni-muenchen.de>.
On Wednesday 15 August 2007 08:49, Andreas L Delmelle wrote:
> On Aug 14, 2007, at 10:08, Philipp Wagner wrote:
>
> Hi
>
> > I am currently trying to convert WordML-documents to XSL-FO and
> > then PDF
> > using the wordml2fo XSL Script by RenderX and Microsoft [1]. This
> > embeds images into the FO file like that:
> >
> > <fo:external-graphic
> >
> > src="url("data:image/auto;base64,H4sIAAAAcBZxWR==
")"/>
> >
> > (shortened, no valid base64-string any more)
> > This seems to use a URI scheme described in RFC 2397 [2].
> > FOP 0.93 doesn't seem to support this URI scheme and this way of
> > embedding images.
>
> Strange... I seem to remember that we did add support for data-URIs
> at some point.
>
> Can you post more details? What is the exact error message you
> receive?
Oh, I was drawing conclusions a bit too fast then. After a bit of
further investigation, it turned out:
* the base64-encoded image was a gzipped wmf-file
* data URLs work fine with the supported image types (e.g. PNG)
But two things may be improved a bit:
* add a short note to
http://xmlgraphics.apache.org/fop/0.93/graphics.html, that data urls
are supported and are a way of embedding graphics into a fo file.
* the error message I got from fop was (shortened the base64-string, as
it is always displayed completeley):
philipp@ipk018:~/Documents/wordml2fo> fop test3-simple.fo -pdf test3.pdf
[Fatal Error] :1:1: Content is not allowed in prolog.
16.08.2007 09:11:10 org.apache.fop.image.analyser.XMLReader
createDocument
WARNUNG: Error while constructing image from XML
org.xml.sax.SAXParseException: Content is not allowed in prolog.
[stacktrace skipped]
16.08.2007 09:11:10 org.apache.fop.image.ImageFactory loadImage
SCHWERWIEGEND: Error while recovering image information
(data:image/auto;base64,H4ACC33cBZxW...bHJQmAAJ==) : null
java.lang.NullPointerException
16.08.2007 09:11:10 org.apache.fop.fo.flow.ExternalGraphic bind
SCHWERWIEGEND: Image not available:
url("data:image/auto;base64,H4sIAAA...RIxHJRU
(SCHWERWIEGEND = FATAL)
Maybe an error message could be implemented which gives a bit more clue
about the real problem, the unsupported image format.
Thank you for your help!
Philipp
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: using fo:external-graphic with a data:image/auto;base64 URI
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Aug 14, 2007, at 10:08, Philipp Wagner wrote:
Hi
> I am currently trying to convert WordML-documents to XSL-FO and
> then PDF
> using the wordml2fo XSL Script by RenderX and Microsoft [1]. This
> embeds images into the FO file like that:
>
> <fo:external-graphic
> src="url("data:image/auto;base64,H4sIAAAAcBZxWR==
")"/>
>
> (shortened, no valid base64-string any more)
> This seems to use a URI scheme described in RFC 2397 [2].
> FOP 0.93 doesn't seem to support this URI scheme and this way of
> embedding images.
Strange... I seem to remember that we did add support for data-URIs
at some point.
Can you post more details? What is the exact error message you receive?
Cheers
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org