Birt runtime does not interpret embedded HTML while exporting to PDF

Sandeep Lulla
edited February 11, 2022 in Analytics #1
<p>Hi,</p>
<p> </p>
<p>We use birt report api 4.3 for exporting to PDF and word documents.</p>
<p> </p>
<p>The issue we are currently facing is that the birt engine does not process the embedded image within html as a result, we get "The resource is not reachable" message instead of the image in the html.</p>
<p> </p>
<p>Version of birt runtime : 4.2</p>
<p> </p>
<p>Attached is the sample code and the output file for the same.</p>
<p> </p>
<p>Please assist on how to resolve this.</p>
<p> </p>
<p>Thanks </p>
<p>Sandeep</p>
<p> </p>

Comments

  • <p>The issue you are facing is due to rendering the image using HTML <img> tags within an html text element. These use the browser to decode the image client side which means they are not able to be decoded during server side rendering when the PDF is created.</p>
    <p> </p>
    <p>Instead, you can use a dynamic image element with a bit of script in the onCreate method to decode the base64 image into the dynamic image element. This will allow the image to be displayed in PDF as well as HTML output.</p>
    <p> </p>
    <p>Take a look a the modified version of your sample report I have attached. I have included a dynamic image element instead using this method which properly displays in PDF as well as HTML.</p>
    Warning No formatter is installed for the format ipb
  • <p>Hi JFreeman, is it possible also with BIRT 2.6? The example you uploaded was with a earlier version..</p>
  • <p>The same should work and be possible using BIRT 2.6.</p>
    <p>I have attached the same example but changed to be version 2.6</p>
    Warning No formatter is installed for the format ipb