1

I have a file where locations have photos and PDF attachments stored as BLOBs. Using the HTML widget, I have gotten it to show the photos as per a previous answer on this forum.

I'm not sure how to do the same for the PDFs. I have very limited knowledge in both QGIS and code so quite frankly I have no idea what I'm doing.

Nothing I've tried has worked. This is the furthest I've gotten:

fileName=(expression.evaluate("\"ATT_NAME\""));
fileType=fileName.slice(-3)

if(fileType == "jpg"){ document.write(expression.evaluate(" '<img width=&quot;100%&quot; src=' || '&quot;data:image/png;base64,' || to_base64(&quot;DATA&quot;) || '&quot;>' ")); } else{ document.write(expression.evaluate(" '<object data=' || '&quot;data:application/pdf;base64,' || to_base64(&quot;DATA&quot;) || '&quot; type='application/pdf'>' ")); }

How can I display a PDF?

Leo Wang
  • 11
  • 2
  • 2
    Welcome to GIS StackExchange! Please add a link to the previous answer that was helpful to solve the photo part of your problem. This allows others to better understand your issue. – winnewoerp Nov 05 '23 at 17:08

0 Answers0