I discovered this is an error in DataURIResolver.
In DataURIResolver the StreamSource created does not the systemid is
never set, thus causing a null value for originalURI which triggers a
NullPointerException.
ImageFactory {
loadImage {
mageReaderFactory.make(source.getSystemId(), in, ua)
}
}
A simple fix in DataURIResolver and rebuilding fop (from the latest
sourc distribution) aalleviates the issue:
source.setSystemId(href);
return source;
I will report this as a bug. Testing this also revealed and error for
PNG files where the transparency layer render black but that is another
issue and coverting to a jpeg fixed that issue.
>-----Original Message-----
>From: Ryan,Peter (Contractor) [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, January 16, 2008 8:47 PM
>To: [email protected]
>Subject: Data URI Support for RTF ExternalGraphic
>
>I have run into an issue with generating an RTF that includes
>a data uri
>for an external image. This document generates correctly in PDF.
>
>The offending fo:
>
><?xml version="1.0" encoding="UTF-8"?>
><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master master-name="masterLayout">
> <fo:region-body region-name="xsl-region-body" />
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence master-reference="masterLayout">
> <fo:flow flow-name="xsl-region-body">
> <fo:block id="cover_image">
> <fo:external-graphic
> src="DATA_URI" />
> </fo:block>
> </fo:flow>
> </fo:page-sequence>
></fo:root>
>
>To properly run this example I am using the first DATA_URI
>example (HTML
>fragment) from here, removing the line breaks:
>http://en.wikipedia.org/wiki/Data:_URI#Examples
>
>As I mentioned the document generates correctly in a PDF but
>when in RTF
>I receive the following exception within the generated document (the fo
>transformation itself issues no errors):
>
>org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic$Exte
rnalGraph
>icException
>org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic$Exte
rnalGraph
>icException: The attribute 'url' of <fo:external-graphic> is null.
>
>Is this a bug, an unsupported (data uri's for external graphics in RTF)
>feature, or am I doing something wrong?
>
>Thank you!
>
E-MAIL CONFIDENTIALITY NOTICE: The contents of this e-mail message and any
attachments are intended solely for the
addressee(s) and may contain confidential and/or legally privileged
information. If you are not the
intended recipient of this message or if this message has been addressed to you
in error, please
immediately alert the sender by reply e-mail and then delete this message and
any attachments. If you
are not the intended recipient, you are notified that any use, dissemination,
distribution, copying, or
storage of this message or any attachment is strictly prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]