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

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

问题描述

我有 MIME 多部分数据,我想使用 XSL:FO 将其转换为 PDF.我很舒服阅读 MIME 使用 Apache James 和我掌握了 嵌入图像数据在 Mime 或 内嵌图像在 HTML 中.我努力搜索 "[xsl-fo] inline graphics""[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>')"/>

应替换为您的 JPEG 图像的 base64 数据字符串.

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

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

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