使用XSL:FO将附件添加到PDF [英] Use XSL:FO to add attachments to PDF
本文介绍了使用XSL:FO将附件添加到PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在SO的帮助下解决内嵌图像后,我需要整理内联附件. PDF可以包含附件,我发现: fo:declarations-pdf:embedded-文件,但它再次指向外部文件.如何附加属于MIME消息(很可能是BASe64)的文件?
After resolving inline images with help from SO, I need to sort out inline attachments. PDF can contain attachments and I found:fo:declarations - pdf:embedded-file but again it pointed to an external file. How can I attach a file that is part of a MIME message (most likely BASe64)?
推荐答案
在最新的FOP版本中,您可以对pdf:embedded-file
使用与fo:external-graphic
相同的语法,并直接附加base64数据:
In the latest FOP builds, you can use the same syntax for pdf:embedded-file
as for fo:external-graphic
and directly append the base64 data:
<fo:declarations>
<pdf:embedded-file filename="myfile.pdf" src="data:application/pdf;base64,<DATA>"/>
</fo:declarations>
...
<fo:basic-link external-destination="url(embedded-file:myfile.pdf)">Embedded PDF</fo:basic-link>
这篇关于使用XSL:FO将附件添加到PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文