PDF Hyperlink
Put your file somewhere under the
/source
folder. For convenience, I created a folder for my PDFs and put my PDF fileexample.pdf
under/source/pdfs
.Calculate the relative location to
/source
folder for your PDF file. The relative location forexample.pdf
is/pdfs/example.pdf
.Put an anchor to your PDF.
1
<a href="/pdfs/example.pdf">this</a>
And it turns out like this.
If you would like to open the PDF file in a new tab, simply add an attribute
target='_blank'
1
<a href="/pdfs/example.pdf" target='_blank'>this</a>
And it turns out like this.
Instead of PDFs, you can locate other formats (images, videos, etc), using this method. But if your browser doesn't support the format, it prompt an file for you to download.
Embed PDF
Again, put the relative location into src
attribute in the following code.
1 | <embed src="/pdfs/example.pdf" width="90%" height="650px" /> |
It turns out like ...
Feel free to change the values of width and height.
BTW, if you cannot see the embedded PDF, sorry, your browser doesn't support this feature.