Embed pdf in html

Embed pdf in html



I'm trying to embed a pdf file in my page...

I've founded the this code and tryed it but I had no result... could you help me?

here it is:

"<embed height=""166"" src="""+ TableRecords1.List.current.FILE.FileName + """ type=""application/pdf"" width=""216"">"


Hi Miguel,

Some ideas about your problem :

- Do you close de <embed> tag? (with a </embed> tag)
- Is the expression TableRecords1.List.current.FILE.FileName returning a meaningful value? Try to view the source of the HTML page, to check if it matches your expectations.
- I've also checked some other examples that do not specify the MIME type (Application/Pdf). Did you try letting the browser specify it for you?
- Finally, and for legibility sake, use ' instead of " inside the expression. This way you don't need to double the " and it makes it a lot easier to read.

Hope it helps! Get back to me if you need anything else.

I'm also trying to pull this off, but my page doesn't show me the pdf.

This is the code in my expression:

"<embed src='"+TableRecords1.List.current.FILE.FileName+"' width='500' height='650'></embed>"

I know for sure that the source is retrieving the correct filename, but it's not showing on page.

Any ideas?

Thanks in advance,

Hi Rui,


If you go to http://<yourserver>/<eSpaceName>/Filename can you download the file?

Does the filename have a .pdf extension?

Do you have Adobe Acrobat installed on your computer?



Tiago Simões

Hi Tiago,

I can't download the file. Says the page cannot be found.
Yes, it has PDF extension and i do have acrobat.


In that case the problem is not with the embedded pdf viewer, it's with the download. 


- If you have the file in the database make sure you create a web screen with a download tool in the preparation and then use that screen URL in the embed object


- If your file is in the server filesystem make sure you have the correct path.



Tiago Simões


Hello all,

I've followed the above instructions and was able to create a pop-up that shows an embeded pdf from a binary in the database and  it works fine in IE7, IE8 and Firefox,  if I upload pdf file using a normal Input Filename widget.

As I have a lot of pdfs to upload,  I created an action using Directory_ListFiles and File_ReadBinary actions from the Filesystem extention, to upload and associate each pdf file to the correct record in the database.

With this method I can only see the embeded pdf in Firefox, in the IE's it shows an image icon, like it is trying to show a picture but doesn't find it.

I have more than 130 pdfs  and I don't want to upload 1 by 1.

Any ideias?

Nelson André

Hi Nelson, you are using a download widget, right?
Could it be the Mime Type that is causing the problem? Try changing it and see if the browser reacts in another way.


Daniel Lourenço

You are correct.
I was not filling the mime-type.

Firefox is smart enough to recognize it but not IE.

Nelson André

Hi all,
I am trying to embed a pdf in a webpage, and i found this code to embed a pdf with a pdfviewer in the webpage.

<iframe src="http://docs.google.com/gview?url=http://example.com/mypdf.pdf&embedded=true" 
style="width:718px; height:700px;" frameborder="0"></iframe>

just insert a new page to download the pdf from the database, and in the url typed the url of that page, but dont work.

here the OML, is from a example i found in the forum.
what i am doing wrong??

to embed pdf in html, i think the first step is to convert the pdf into html.  if you wanna do that without any plug-ins you can use gmail or other emails. Just compose a letter(of course you can leave it empty) and attach the PDF files then send them to yourself. Check this email in “Inbox” then you can open the attached pdf files in html form.besides, another way is to employ an imaging sdk which contains the function of converting pdf into html, i can share with you the converter iam using currently. good luck.
Hi Luis

Have a look at the following link  http://pdfobject.com/ on how to embed a pdf in you application. Works for me.



If you had hosted your file on google drive then you can get embed code directly
while if you want to add any pdf file in html of post or page then you have to
edit html of post.For more info you can check details here.I Hope this will help you completely.

The last post on this thread was three years ago. Please don't reply if it's that old.