|
|
Rank: Member
Joined: 8/28/2007 Posts: 20
|
Hello,
i'm building an sps file. I would like to insert an image whose data is included in the XML data file. HTML provides a special tag for this: http://en.wikipedia.org/wiki/Data_URI_scheme, which permits to store the image data directly in the tag, without the need to reference an external data source (external url).
As i understand this feature cannot be used in StyleVision. It's a pity because FOP has the support for this kind of feature. If somebody was able to use this kind of tags with StyleVision can he share the knowledge with me, please?
thank you.
Fabio
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Fabio,
what is the reason to embed images in HTML and risk incompatibility with older browsers?
Also, FOP has nothing to do with this, because FOP is only used for PDF - not for HTML!
|
|
Rank: Member
Joined: 8/28/2007 Posts: 20
|
vlad wrote:Fabio,
what is the reason to embed images in HTML and risk incompatibility with older browsers?
Also, FOP has nothing to do with this, because FOP is only used for PDF - not for HTML!
FOP and browser are not an issue, because we transform to PDF and then show the PDF to the user. Embedding the image would permit us to be completely independent from the filesystem.
We have images in Blob table fields on ORACLE. We would only need to encode them in Base64, create the XML with the data, call the FOP and show the result to user. No filesystem I/O required.
I tried to put the full <img> tag in a CDATA, and then show it as text. But the "<" and ">" are then escaped when shown. Maybe somebody found a way to achieve this result.
greetings, Fabio
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Ok, now I'm completely lost. Do you want to say that you have an issue with embedding an image in your HTML output? In PDF output? In XML input? And if you put an <img> tag with CDATA - what does it all have to do with FOP?
|
|
Rank: Member
Joined: 8/28/2007 Posts: 20
|
vlad wrote:Ok, now I'm completely lost. Do you want to say that you have an issue with embedding an image in your HTML output? In PDF output? In XML input? And if you put an <img> tag with CDATA - what does it all have to do with FOP?
Let's forget FOP. I want to build an XML which also includes the image data (using URL data schema) and i want to be able to design a stylesheet over this xml. I don't want to save images on filesystem.
The question is: is there a way to do this or not?
Is it clear now?
greetz, Fabio
|
|
Rank: Member
Joined: 8/28/2007 Posts: 20
|
vlad wrote:Ok, now I'm completely lost. Do you want to say that you have an issue with embedding an image in your HTML output? In PDF output? In XML input? And if you put an <img> tag with CDATA - what does it all have to do with FOP?
Let's forget FOP. I want to build an XML which also includes the image data (using URL data schema) and i want to be able to design a stylesheet over this xml. I don't want to save images on filesystem.
The question is: is there a way to do this or not?
Is it clear now?
greetz, Fabio
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
Yes, it is clear now. And, no - with current version this won't work. The upcoming v2010 will have a disable-output-escaping possibility, which allows you to pass nodes unchanged, which will probably do what you asked. We have no fix due date for v2010 though.
|
|
Rank: Advanced Member
Joined: 12/13/2005 Posts: 2,856 Location: Mauritius
|
v2010 has been released now
|
|
Rank: Member
Joined: 8/28/2007 Posts: 20
|
WOW. It works!
Added this piece of code in my XML file:
<title><![CDATA[<fo:external-graphic src="url('data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7')" height="3cm" width="3cm" />]]></title>
And then mapped this node as an unparsed content in my stylesheet. And when i render with FOP my image is shown.
Great.
Fabio
|
|
|
guest |