This article deals with how you can publish a PDF file on a website and link to it using the BlueGriffon web editor.
I will assume that you already have a PDF file that you want to add to your site. If you don't have one, many word processors, including current versions of Microsoft Word, have an option where you can save (or export) your document in the PDF format. There are also numerous free PDF printer drivers around which you can use to produce such files even from programs that do not have built-in PDF support. (That is, install those drivers, and when you want to print, select the PDF driver as your printer, and the driver will save the printed output as a PDF file.)
This article also assumes that you already have a website. If not, please read How to Start a Website. You should also know how to use the BlueGriffon web editor.
Since you are using BlueGriffon for your site, you will probably have a folder on your computer where you saved your website files (prior to uploading it to your site).
Copy the PDF file into that folder. For example, if you have a folder called "c:\Users\thesitewizard\Documents\MyWebsite" into which you placed your "index.html" and other website files, copy the PDF to that same subdirectory.
Do not skip this step, or your link won't work correctly later.
Start up BlueGriffon and open the web page on which the link should go.
For example, if you want to link to the PDF from your "index.html" file, open the latter in the editor. You can do this by clicking "File | Open File" from the menu (that is, click "File" from the menu bar, followed by "Open File" in the drop down menu that appears), navigating to the folder containing the relevant file, clicking it once to select it, and clicking the "Open" button.
Select the text that you want to make into a link. For example, if your page says "click here to open or download the PDF of my novel", and you want to make those words into a link, drag your mouse over them to highlight them. Alternatively, if you want to make a picture into a link that leads to the PDF file, click that image once to select it.
Once the text or picture is selected, click "Insert | Link" from the menu.
The "Links" dialog box will appear. Click the folder icon next to the Target field in that box. This will open another dialog box, this time with the title "Select a file". Navigate to your PDF file, select it, and click the "Open" button.
Click the "Make URL relative to page location" checkbox to put a tick in it. This is needed. If you don't do this, your link will not work when your page is on your real website.
Look at the Target field. It should now show the name of your PDF file. If the name is prefixed with a string
of characters starting with "file:///
", it means that you have not put a tick in the
"Make URL relative to page location" checkbox.
Click the "OK" button.
Save the page with "File | Save".
Publish your modified page in the usual way to your website, remembering also to upload the PDF file. Make sure to place the PDF file in the equivalent folder on your web server. For example, if the PDF was in the folder containing your home page on your own computer, it should be in the same folder as the home page on your web server as well. If you don't, the relative link that you placed pointing to the file will be broken.
For those who have never uploaded their website before, and therefore do not know what "the usual way" (of uploading or publishing) means, please see How to Upload a File to Your Website Using the FileZilla FTP Client. Alternatively, you can also read How to Publish (Upload) Your Website with BlueGriffon for another way to do it. (Read one or the other. You don't need to do both. These are just 2 of the zillion ways of uploading a website.)
Go to the page containing the link using your web browser and click it.
If your browser has a built-in PDF viewer, and it is enabled, the PDF file will open in the browser. Alternatively, if it has a PDF plugin from a third party (usually Adobe), the file will open in that third-party PDF reader.
If you have set up your browser to download the PDF file by default, or you have disabled both the internal PDF viewer and all third-party PDF plugins, the browser will probably present you with a prompt to download and save the PDF file.
If any of the above situations occur, it means that you have uploaded and linked to your PDF file correctly.
If you get an error message to the effect that the PDF file could not be found, it means that your link did not point to the PDF file, in spite of what you think. This could be due to one of the following causes:
You failed to make the link into a relative link, but left it as a absolute link pointing to a file on your own
computer (and not website). To see if this is the case, while still in your web browser looking at your "live"
website, move your mouse so that it hovers over the link. Look at your browser's status bar to see what the
link says. If the web address starts with "file:///
", it means you have forgotten to enable the
"Make URL relative to page location" setting.
You did not put your PDF file into your website folder on your own computer before making the link. That is, you skipped the first step earlier, the one I where I said "Do not skip this step, or your link won't work correctly later."
You did not upload the PDF file to the equivalent folder on your web host's computer. The location where you put the PDF file on your website proper must match the mirror copy on your own computer. For example, if it was in the main web directory, along with your home page, on your own computer, it must also be in the main web directory along with your home page on your website.
Copyright © 2018 Christopher Heng. All rights reserved.
Get more free tips and articles like this,
on web design, promotion, revenue and scripting, from https://www.thesitewizard.com/.
Do you find this article useful? You can learn of new articles and scripts that are published on thesitewizard.com by subscribing to the RSS feed. Simply point your RSS feed reader or a browser that supports RSS feeds at https://www.thesitewizard.com/thesitewizard.xml. You can read more about how to subscribe to RSS site feeds from my RSS FAQ.
This article is copyrighted. Please do not reproduce or distribute this article in whole or part, in any form.
It will appear on your page as:
How to Upload and Link to a PDF File with BlueGriffon