1

I have a quick question that I believe is a simple fix.

I am trying to embed a local PDF into my web application in which I'm using flask to host.

I have tried:

<ul style="list-style-type:circle">
  <li><iframe src="/home/name/Desktop/name.pdf"></iframe></li>

And it is not working.I have tried removing the path to name.pdf and modifying it as well.

I have also tried a variety of other things.

<li><object width="400" height="400" data="name.pdf"></object></li>

As well as

<li><a href=":/home/name/Desktop/name.pdf">NAME</a></li>

I have messed around with the path here, too.

Is this actually possible? I believe it is and my path/to/file is incorrect!

1 Answers1

0

You are using a forward slash (/). To access a PDF on your local you should use a backslash (\). Here's an example path to access your PDF on you desktop:

<li><iframe src="file:///C:\Users\userName\Desktop\yourPDF.pdf"></iframe></li>

To get the correct path, you can drag the PDF into your browser and copy the link from the address bar.

Moses Davidowitz
  • 982
  • 11
  • 28