How do I link to a Bookmark inside a Confluence-hosted PDF file?
Asked by Trevor Pike:

I want to be able to create a link in a Confluence page which links to a specific bookmark/location/page within a Confluence-hosted PDF. The PDF files I have tend to have many pages where only specific sections are relevant for my team, so I'd like to use a Confluence page as an index into the document. The documents are provided by a third-party, and I'd rather not have to manually extract the relevant content.

I notice that Confluence has its own PDF viewer which allows bookmarks to be created and given comments. **Is it possible to link to a specific one of these bookmarks within the PDF and have it open the PDF at that bookmark using the Confluence viewer?** (This would be an ideal solution.)

Alternatively, because we use Google Chrome as our browser of choice, we can add "#page=15" or similar to the end of the link so that Chrome can open the PDF file to the specified page. Unfortunately, Confluence seems to lack a way to specify a direct link to the PDF file without using either the internal viewer or a Content-Disposition header (which causes the browser to prompt to download the file instead of viewing it). **Can I create a link to a Confluence-hosted PDF that doesn't include the Content-Disposition header?**

This is for migrating our knowledgebase from SharePoint where we use links with the "#page=" format to link to the relevant PDF page.  

Many thanks


Answers:
author: Diego
body: Hello there Trevor! Currently, there is no feature in Confluence that allows this specific behaviour. We do have two open reports about this feature:

**- [CONFSERVER-54342](https://jira.atlassian.com/browse/CONFSERVER-54342)**

**- [CONFSERVER-7941](https://jira.atlassian.com/browse/CONFSERVER-7941)**

The workaround presented under 54342 is this:
> **1 - Access the desired page with the PDF attached to it
> 2 - Go to the Attachment Section (Little clip ot the right side of the padlock at the top of the page)
> 3 - Click view in the desired attachment
> 4 - Navigate to the desired page, the one you want to link
> 5 - Right click and select Copy image address
> 6 - Go back to the page and edit it
> 7 - Paste the link you just copied
> 8 - Save the page**

There are some limitations to this workaround:

- You can not navigate the entire document directly from that preview

- When clicked, the page will open straight to the current tab, users must ctrl+click or right click and select open in another tab

You could vote and watch the reports! Voting increases the report visibility with our teams and watching will keep you up to date with anything that happens there.

<br />

I have tested the workaround in Chrome and it works as expected! Let us know if this helps out.

comments: author: Trevor Pike
body: Diego, thanks for you reply. I'll give the workaround a try but I can easily imagine it being a suboptimal solution if the relevant section I want to reference spans multiple pages of the PDF.  

I've added my vote to the open suggestion you linked, it sounds very much like my preferred solution above which keeps things in the Confluence way of doing things. I'll also add comments to both suggestions, hopefully the Atlassian Team can reconsider this.  

With my software developer hat on, it's extremely frustrating as I know it would only require a method (querystring parameter, for example) to reference a Confluence-stored file without the server setting a Content-Disposition header which triggers the browser to download it. Then a link can be constructed that uses the browser's own PDF viewer and can honour a #page= anchor added to the link.  

For example: <https://MY-SITE.atlassian.net/wiki/download/attachments/123456789/MyDocument.pdf?viewDocument=1#page=10>  

With my project manager hat on, it's extremely frustrating as I cannot migrate my project documentation into Confluence from Sharepoint because of this. While Sharepoint has an internal PDF viewer like Confluence, I can reference the file directly there and add #page= as appropriate.  

Many thanks


Tags: cloud

confluence-cloud