Ecrion Software Inc. Homepage
Forum Home Forum Home > XF Rendering Server > Generic Support
  New Posts New Posts RSS Feed: Base64 Image works in Designer, but not WS
  FAQ FAQ  Forum Search   Register Register  Login Login

Forum LockedBase64 Image works in Designer, but not WS

 Post Reply Post Reply
Message / View First Unread Post
Alexandru View Drop Down

Joined: 03 Oct 2011
Posts: 7
Post Options Post Options   Quote Alexandru Quote  Post ReplyReply Direct Link To This Post Topic: Base64 Image works in Designer, but not WS
    Posted: 21 Oct 2011 at 1:57pm
In the designer I was able to insert a new image producing the following definition in my XFD file:

<xfd:attribute-value object="16B8637C" attribute="fo:src" dynamic-value="/document/metadata/logo"/>

<fo:external-graphic src="" content-width="scale-to-fit" content-height="scale-to-fit" scaling="uniform" id="16B8637C"/></fo:block>

Clicking on the PDF preview button produces the correct PDF output with images included.

However, after exporting the XFD to XSL, and sending it over SOAP to the Ecrion WS - I get the PDF but without images.

In both cases the same content XML is used.

Here is a snippet from the generated XSL mentioned above:

<fo:external-graphic src="url()" content-width="scale-to-fit" content-height="scale-to-fit"
                     scaling="uniform" id="16B8637C">
    <xslt:attribute name="xf:compat-id">id1689573<xslt:value-of select="generate-id(.)"/>
    <xslt:attribute name="id">16B8637C</xslt:attribute>
    <xsl:attribute name="src">
        <xsl:value-of select="/document/metadata/logo"/>
Replacing the xsl:value-of line with this works:
<xsl:value-of select="concat('url(data:image/jpg;base64,',/document/metadata/logo,')')"/>

How can I get the XF designer to automatically generate the required "url()" wrapper and perhaps also the "data:image/jpg;base64" prefix as well without having to modify the exporting XSL file in order to get images working.

Thank you very much for the help.
Back to Top
radup View Drop Down
Admin Group
Admin Group

Joined: 19 May 2008
Posts: 90
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post Posted: 24 Oct 2011 at 3:16am
Hi Alexandru,

Change the xpath of the dynamic value to: concat('url(data:image/jpg;base64,',/document/metadata/logo,')').
And, it looks like this:
<xfd:attribute-value object="16B8637C" attribute="fo:src" dynamic-value="concat('url(data:image/jpg;base64,',/document/metadata/logo,')')"/>
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz

This page was generated in 0.078 seconds.