简体   繁体   English

使用XSL-FO生成位图

[英]Bitmap generation using XSL-FO

I'm creating a template in XSL to use with another application. 我正在XSL中创建一个模板,以与另一个应用程序一起使用。 The application has model views that come in the form of links that I can copy to the clipboard. 该应用程序具有模型视图,这些视图以链接的形式出现,我可以将其复制到剪贴板。 In Microsoft Word, I can do Paste Special to Bitmap, generating an image from that link. 在Microsoft Word中,我可以将特殊粘贴到位图,然后从该链接生成图像。 Here's an example. 这是一个例子。

I can't figure out how to accomplish this using XSL. 我不知道如何使用XSL完成此操作。 I've tried using: 我试过使用:

<fo:external-graphic src="url('JTCmd://MV/Mjg1MjEyNjcz/Q0hMRDAwMDAIQ0RQbGF5ZXIuYXNtOzA7MTo=')" content-width="10mm" content-height="scale-to-fit"/> 

but as my link is not a link to a local image or an image on the web, XSL cannot generate it, giving an "Image not found" error. 但是由于我的链接不是指向本地图像或Web图像的链接,因此XSL无法生成它,并显示“找不到图像”错误。 Is generating an image in this way possible in XSL? 在XSL中可以通过这种方式生成图像吗? What else can I try? 我还能尝试什么?

It is not clear what data you have that follows the JTCmd: custom uri. 目前尚不清楚您遵循JTCmd:自定义uri拥有哪些数据。 You can use a base64 encoded image in fo:external-graphic, so your code would need to generate the proper base64 encoded image using a data: uri and mimetype and then do something like this (assuming you had a JPEG image): 您可以在fo:external-graphic中使用base64编码的图像,因此您的代码将需要使用数据uri和mimetype生成正确的base64编码的图像,然后执行类似的操作(假设您拥有JPEG图像):

 <fo:external-graphic src="url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4QBYRXhpZgAAT ... AFABQAUAFABQAUAf//Z')"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM