Is there an easy way to set a pdf link (link to a file within the website) open in a new window? I am sure this must be something to do with the code, but it is the first time I have been asked to do this.

Thanks in advance

2 Answers 2


Simply add target="_blank" in your anchor tag.

It will open pdf in new tab instead of same page.

<a href="https://www.clickdimensions.com/links/TestPDFfile.pdf" target="_blank" title="Read PDF">Open PDF</a>

Are you opening this with a hyperlink?

If so just add the key target="_blank" to your hyperlink: Example:

<a href="url_to_your_pdf" target="_blank">Open</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.