Question
Con Skordis · Jul 12

Embedding png images in PDF Report

I have a ZEN PDF report that prints headers and footers with images correctly but when I try to embed an image into a table it does not print.

Are there examples snippets where a fully url qualified image can be embedded within the <table><item><img> tags?  

Product version: Caché 2018.1
00
1 0 2 55
Log in or sign up to continue

Here's a working example using <img> in a <table>. I don't think you can put an <img> inside an <item> or inside another <img>.

<table orient="col">
            <block width="40%">
                    <img src="http://localhost/logo.jpg" contentHeight="0.56in" contentWidth="2.33in" style="text-align:left"/>
            </block>
            <block width="40%">
                <table orient="col">
                        <item field='#(..pagetitle)#'/>
                </table>
            </block>
            <block width="20%" style="text-align:right;">
                  <item field='#(..subtitle)#'/>
             </block>
</table>

<img> can be used directly and does not need to be embedded in an <item>. So for example

<table orient='col' group='Film' width='100%'>
      <item field='@Title' caption="Film Title" width="40%"/>
      <item field='@Rating' caption="Film Rating" width="15%"/>
     <img contentHeight="30mm" contentWidth="20mm" src='lotterylogo.jpg' />
</table>

I've used the direct reference to lotterylogo.jpg because I was running my report from within the /csp/samples but I could have done the full reference URL as shown below
<img contentHeight="120mm" contentWidth="140mm" src='http://localhost:57775/csp/samples/lotterylogo.jpg/>