pdf generation - Java load image from database as the byte stream and load it in xsl -
image saved in database byte stream , have load image in xsl. in xsl whether loading image database possible ?? if how can done. in xsl used load static image , need load dynamic content
let's assume have database , storing image can retrieve in way. image identified id ... "1234567". assume xml has in it, like:
<imageid>1234567<imageid>
you xsl take info , could:
1) create custom protocol , java url handler , register it. simply utilize in url src attribute of fo:external-graphic ... example, create , register custom protocol "getimage" , handler returns image. might have:
<fo:external-graphic src="getimage://myserver.com/images/1234567"/>
for code samples, search "create own java url handlers" in web. resource: http://docstore.mik.ua/orelly/java/exp/ch09_06.htm
2) create servlet returns image, may have:
<fo:external-graphic src="http://myserver.com/getimage.jsp?image=1234567"/>
you have decide how image database , stream back, setting appropriate info in headers recognized image type in question.
pdf-generation xsl-fo
No comments:
Post a Comment