0

Issue

Load a image using the fo:external-graphic tag. I have a parameter with the base64 value of the image.

<xsl:param name="Name">data:image/jpg;base64,/9j/4AAQSkZJRgA..</xsl:param>

I have tried to load the image using

<fo:external-graphic src="{$Name}" width="40mm" height="18.25mm" >
                        </fo:external-graphic>

Error

I get an error uri is not recognized enter image description here

XSLT

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"  xmlns:m="http://www.ibm.com/maximo"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format" >
  <xsl:output method="xml" version="1.0" encoding="UTF-8"  indent="yes" />



  <xsl:param name="Name">data:image/jpg;base64,/9j/dddds....ghP/Z</xsl:param>
  <xsl:template match="/">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

      <fo:layout-master-set>
        <fo:simple-page-master master-name="hello"
                    page-height="11in"  page-width="8.5in" margin-top="1in"
                    margin-bottom="1in" margin-left="1in" margin-right="1in">
          <fo:region-body margin-top="1in" margin-bottom=".5in"/>
        </fo:simple-page-master>
      </fo:layout-master-set>

      <fo:page-sequence master-reference="hello">
        <fo:flow flow-name="xsl-region-body">
          <fo:block font-size="18pt" text-align="center" font-weight="bold">
            Hello World!

            <fo:external-graphic src="{$Name}"/>
          </fo:block>
        </fo:flow>
      </fo:page-sequence>

    </fo:root>
  </xsl:template>
</xsl:stylesheet>

I am using Fonet.dll

user1339913
  • 1,017
  • 3
  • 15
  • 36
  • 1
    The error messages sounds as if your FO processor does not support or recognize `data` URLs. – Martin Honnen Jan 15 '16 at 10:29
  • I there any way around it I mean any .net FO Processor that could work with Images. – user1339913 Jan 15 '16 at 11:11
  • 2
    I don't know details about FO processors but I would assume that simply providing a URI to a JPG file has better support than using a `data` URI. – Martin Honnen Jan 15 '16 at 12:05
  • 2
    AH Formatter has a .NET interface (http://www.antennahouse.com/product/ahf60/docs/ahf-dotnet.html) and understands the `data:` scheme (http://www.antennahouse.com/product/ahf60/docs/ahf-gra.html). – Tony Graham Jan 15 '16 at 14:10
  • 1
    Just as in your other post about this formatting engine, it is very old. Last updated in 2009 I think. This is 2016, personally I would think about using software that is not 7 years old. – Kevin Brown Jan 16 '16 at 05:30

0 Answers0