Show appian image in pdf generated

Certified Senior Developer

I can generate a dynamic pdf using html template and html template from doc service followed by PDF from HTML smart service. But cant display image. In html template i am using image src and in src i make it as pv and pass the image field/rich text image with document image having document id from appian. Image is displayed as image icon but no image displayed. Any idea on how to get these done dynamically?

Thanks in advance

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Stefan Helzle

    After updating my post, I started to investigate the source code of the plugin and found an undocumented feature. You can easily add an image, uploaded into Appian, using the following HTML.

    <img appianDocId="12345" />

    What a welcome surprise !!!

    I had a hard time to adjust the size of the image as the plugin manipulates the inline style of images, but was successful using the following code:

    <!DOCTYPE html>
    <html>
    <style>
    img {
      max-width: 100% !important;
      max-height: 100% !important;
    }
    div {
      width: 50mm;
      height: 60mm;
      border: dotted 5px black
    }
    </style>
    <body>
    <div>
    <img appianDocId="22613" />
    </div>
    </body>
    </html>

    The separate max-width CSS for the image tag made the difference.

    I am going to add this to my post as well.

    Have fun!

Children