XSL:FO/Apache FOP中的嵌入式图像数据 [英] Inline image data in XSL:FO / Apache FOP

查看:127
本文介绍了XSL:FO/Apache FOP中的嵌入式图像数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有要使用XSL:FO转换为PDF的MIME多部分数据.我很舒服使用 james.apache.org/"rel =" nofollow noreferrer> Apache James 和我对中嵌入的图像数据内嵌图片.我认真搜索了"[xsl-fo]内嵌图形" "[xsl] + html + mime + image" ,并以某种方式找到了 precurser .另外 Google上的将HTML MIME转换为XSL:FO" 没有定论.

I have MIME Multi-Part data that I want to convert to PDF using XSL:FO. I'm comfortable reading MIME using Apache James and I have a grasp on embedded image data in Mime or inline images in HTML. I diligently searched SO for "[xsl-fo] inline graphic" and "[xsl] +html +mime +image" and found somehow the opposite and a precurser what I'm up to. Also Google on "convert HTML MIME to XSL:FO" was inconclusive.

我想要做的是在XSL:FO转换的PDF输出中具有一个元素(或一组元素)来呈现图形(JPG/PNG/GIF-全部或其中的一些).图形数据应作为Base64(或其他)编码数据包含在.fo文件的内部中.我发现了如何指向外部图形,但与嵌入式图形数据无关.

What I want to do is having an element (or a set of elements) that render a graphic (JPG/PNG/GIF - all or some of them) in the PDF output of an XSL:FO transformation. The graphic data should be included inside the .fo file as Base64 (or otherwise) encoded data. I found how to point to external graphics, but nothing about embedded graphic data.

那将如何工作?

推荐答案

元素fo:external-graphic也可以用于嵌入内联数据.只需使用以下语法:

The element fo:external-graphic can be utilized to embed inline data as well. Just use the following syntax:

<fo:external-graphic src="url('data:image/jpeg;base64,<DATA>')"/>

<DATA>应该替换为JPEG图像的base64数据字符串.

<DATA> should be replaced with your base64 data string of the JPEG image.

这篇关于XSL:FO/Apache FOP中的嵌入式图像数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆