General Discussion

  • 1.  GET IMAGES FOR CUSTOM DOCUMENTS

    Adopter
    Posted 20 days ago
    Edited by Alicia Rico 20 days ago

    Hello,

    I need to create a form that will be answered and will generate a custom document that includes a few fixed images. Those images will not be a question in the form. Therefore, I will not use resource images.

     In the code of the document, I am just writing:

     <img src="https://…" alt="…" width="...px;" height="...px;"  />

      

    I do not want to publish those images in a public site, for security reasons, where TrueContext can easily access them to add them to the document.

     

    Would TrueContext be able to get them from a sharepoint library? If so, how should we do the call in the document code?

    If not, do you have any other options? Where could we publish those images so that TrueContext could get to them? How would TrueContext get them? 

    I also had the same issue when I wanted to add an image to an email destination.

    Thanks a lot

    #CustomDocuments

    #Images



    ------------------------------
    Alicia Rico
    CI
    Johnson Controls
    ------------------------------



  • 2.  RE: GET IMAGES FOR CUSTOM DOCUMENTS

    Posted 16 days ago

    Hi Alicia,

    TrueContext will not be able to pull the images from SharePoint. But you also do not need to host them anywhere. Convert each image to base64 once and put it straight in the src attribute:
    <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUg.." alt="…" width="...px;" height="...px;"  />

    Base64 increases the payload by roughly a third, so compress the source images first and keep them modest in size. And if an image ever changes, you update the template.

    Hope this helps.



    ------------------------------
    Pradeepti Chollangi
    Implementation Specialist
    TrueContext
    ------------------------------



Reminder: Content posted to our Community is public content.  Please be careful not to post Intellectual Property that you do not have permission to share.  For more information please refer to our Terms Of Use