• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

embed a pdf in webpage created using wordpress

I'm using a them from elegantthemes.

I want to embed a pdf into the webpage. Also, the user must have an option to download it in pdf format  manually.

Thanks!
0
dshrenik
Asked:
dshrenik
  • 5
  • 3
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
I don't think you can do that directly.  Browsers require plugins to display PDFs.   PDF is not a format like JPG and GIF that browsers will display directly.  You might be able to put it in an iframe but that will still depend on the viewer having the PDF plugin installed.
0
 
dshrenikAuthor Commented:
Let us assume that the viewer has the PDF plugin installed.
0
 
Dave BaldwinFixer of ProblemsCommented:
Then try the iframe method.  You don't want to try to open in your main page because the plugin will use the whole page to display the PDF.   Here's a demo that works and a screen shot.  Notice that the Adobe Reader tool bar shows at the top.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>PDF iFrame test</title>
</head>
<body>
<h1>PDF iFrame test</h1>
<p>This is the body.</p>
<iframe height="444" width="555" src="test.pdf"></iframe>
</body>
</html>

Open in new window

PDFiframe.jpg
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
dshrenikAuthor Commented:
Thanks!

Right now, there is a lot of whitespace between the page title and the iframe. Also, can I automatically set the size of the iframe to the max possible?
0
 
dshrenikAuthor Commented:
I toko care of the whitespace.
0
 
dshrenikAuthor Commented:
Also, can I have a black border around the iframe?
0
 
dshrenikAuthor Commented:
Sorry for the multiple requests. Can I have the iframe to be centre aligned within the page layout?
0
 
Dave BaldwinFixer of ProblemsCommented:
Here's the info on iframes: http://www.w3schools.com/tags/tag_iframe.asp  You can center it by putting <center> tag around it.
0
 
Jason C. LevineNo oneCommented:
Late to the party but you can also use scribd.com and the Simpler iPaper plugin to get a really nice PDF display with download options.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now