How to Insert PDF Files in Websites
PDF files are an excellent choice for sharing documents with others because they preserve all fonts and formatting, so the file looks exactly the same on every computer. Additionally, Adobe--the company that created the PDF file format--provides free viewing software for all operating systems, so your viewing audience never has to download special software. Including a PDF document in a website, whether via a link or as an embedded document, requires just a single line of code.
Instructions
-
Insert a Link to the PDF File
-
1
Upload your PDF file to a location accessible via the Internet. The best choice is to upload it to the same directory where your other Web page files are located. If you aren't sure how to do this, upload the PDF to a free file hosting service. Make careful note of the full website address of your PDF file.
-
2
Open the program or website where you normally edit your Web page files. Open the specific page where you want to include a link to the PDF file.
-
-
3
Determine if your web page editing program uses raw HTML code. If it does, you'll see many bits of code that look like this: <P> <EM> <H3> </H3> </EM> </P>
If it does not, you'll see normal text in the same form as it appears in a Web browser. There will also be formatting buttons (similar to the formatting menu of a text editing program like Microsoft Word) to insert images, bold text, change colors, etc.
-
4
Type the following text if your editing program uses raw HTML code where you want the link to appear:
<A HREF="http://www.domain.com/your.pdf">Link to Your PDF</A>
Replace the URL after HREF= with the exact web address for your PDF file.
Replace "Link to Your PDF" with the text you want the link to say.
Save your changes. The link to the PDF file should now appear on your website.
-
5
Type the text you want for your link if your editing program does not use raw HTML code (i.e. "Link to PDF File"). Highlight the text with your mouse.
Look for a button to insert a link. It will likely look like a chain (the kind used to tow cars or secure a lock). Click this button. It will prompt you to insert a URL; enter the exact web address for your PDF file.
Click "OK" and save your changes. The link to the PDF file should now appear on your website.
Embed the PDF File Within a Page
-
6
Upload your PDF file to the Internet. It's easiest if you can upload it to the same folder where your other Web page files are saved. If you're not sure how to do this, upload the PDF to a free file hosting site. Make careful note of the full website address of your PDF file.
-
7
Launch the software program or online service you use to edit your Web page. Open the specific page where you want to embed the PDF. You must be able to edit the HTML code of the page in order to use this method.
-
8
Paste the following code where you want the PDF document to appear:
<embed src="http://www.domain.com/your.pdf" width="500" height="375">
Replace "your.pdf" with the exact URL to your PDF file. (Leave the quotation marks in.) If needed, change the width and height numbers to change the display size of the box where your PDF file appears. (If the width and/or height are too small, a scrollbar will appear.)
-
1
References
Resources
- Photo Credit tax form image by Kirill Zdorov from Fotolia.com