简体   繁体   中英

Bitmap generation using XSL-FO

I'm creating a template in XSL to use with another application. 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. Here's an example.

I can't figure out how to accomplish this using 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. Is generating an image in this way possible in XSL? What else can I try?

It is not clear what data you have that follows the JTCmd: custom 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 src="url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4QBYRXhpZgAAT ... AFABQAUAFABQAUAf//Z')"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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