Ref. ResourceFolder in PDF embed

Hi

I am trying to use the embed function within a widget to display a PDF file that I have dragged into "Resources".
However, I am confused about what the code should look like to display this PDF. When I use the entire path on the computer itself, it appears fine, but I would like it to come together with all the resource files so that it was a complete package with all content.

What should the path look like?

Have tried the following without success:

<embed src= "${resourcesFolderName}/pointtavle.pdf" width="100%" height="100%">

That method of embedding PDFs is deprecated -- here's some recommendations:

And here's more info on embedding:

How to Embed PDF in HTML

To use the example above, you would use this code within an HTML widget, which appears to to display in Chrome and Firefox:

<!DOCTYPE html>
<html>
  <head>
    <title>PDF Example by Object Tag</title>
  </head>
  <body>
    <h1>PDF Example by Object Tag</h1>
    <object data="${resourcesFolderName}/filename.pdf" type="application/pdf" width="100%" height="500px">
      <p>Unable to display PDF file. <a href="${resourcesFolderName}/filename.pdf">Download</a> instead.</p>
    </object>
  </body>
</html>

If the PDF is a single page PDF, you may need to uncheck 'Automatically optimize when exporting' when the PDF is selected in your resource library.

Hi Daniel

Great, that's the way to go.

I have to make some pages that will go into another system (Pixilab). When you embed my page there, it is implemented as an iFrame.

This means that it does not properly refer to the "resource" folder as it comes in via iFrame.

So my question now is whether you can make the "source" path into a URL/Path that I can find on the server I have it all on.

It all runs locally so would like it to refer to the following: 10.20.20.2:8080/pdf_files/test.pdf

How do I get this path in?

Your embed code would look something like this (place inside an HTML widget)


    <object data="http://10.20.20.2:8080/pdf_files/test.pdf" type="application/pdf" width="100%" height="100%">
<p>It appears you don't have a PDF plugin for this browser. You can <a href="http://10.20.20.2:8080/pdf_files/test.pdf">click here to download the PDF file.</a></p>
    </object>