PDF export - some links point back to Confluence instead of within PDF
Asked by Christine Rivers:

I have a set of pages within a space that I want to export to PDF, and I want the Confluence links to be links within the PDF document. Each of the Confluence pages have either "include excerpt" or "include page" on them. The only links that work as expected (convert to link within the PDF), are links to content on same Confluence page/excerpt. For the Confluence pages that have links within same excerpt, the links convert to PDF as expected. For the Confluence pages that have links to content within a different excerpt, the link goes to Confluence page instead. When I export to PDF, how do I get the links to convert to stay within the PDF document instead of pointing back to the Confluence page?


Answers:
author: Steffen Heller
body: Very tricky. I have had problems with links for years and already posted a similiar questions: [Problem with anchor hyperlinks after upgrade (from 3.x to 4.3.2)](https://answers.atlassian.com/questions/109133/problem-with-anchor-hyperlinks-after-upgrade-from-3.x-to-4.3.2)

In short: A combination of links with anchors and nested pages does not work too well.


author: Francis Vila
body: I have this problem with links created in Confluence in a PDF export.

The error message is  
*Adobe Acrobat does not allow connection to :"my.domain.com"*

To create the links, I use the GUI to search then select the target page. I also tried selecting from Recently viewed. I'm not using any include page macro, and the error occurs both in Chrome and in Firefox.

The code for the link looks like this:

\<ac:link\>  
\<ri:page ri:content-title="My page title"/\>  
\</ac:link\>

I also have a table of contents that *does* work.


author: Francis Vila
body: I have this problem with links created in Confluence.

I use the GUI to search then select the target page. I also tried selecting from Recently viewed. I'm not using any include page macro, and the error occurs both in Chrome and in Firefox.

The code for the link looks like this:

\<ac:link\>  
\<ri:page ri:content-title="My page title"/\>  
\</ac:link\>

The error message is  
*Adobe Acrobat does not allow connection to :"my.domain.com"*

I also have a table of contents that *does* work.


author: evanpan
body: I wonder whether the [PDF converter](http://www.pqscan.com/convert-pdf/) I am testing these days could help with that?

comments: author: Reto Weiss
body: Let me know your findings.I still have to live with the fact that anchor links to other pages do not work in PDF, quite a nasty limitation and not what you would expect of a mature product.


author: Steffen Heller
body: @Reto Weiss: Don't give up too soon. The first bug reports about this are less than 4 years old[:S](http://pc.net/emoticons/smiley/sarcastic)


author: Reto Weiss
body: As I already mentioned in the comment above, there is currently no workaround for this issue. The include-approach doesn't work for me, hance I have to live with the fact that links to anchors simply do not work, in exported PDF.


author: Steffen Heller
body: Hi @Reto Weiss

no, it is a bit different...

To get more information you can read the following bug reports (among others):

<https://jira.atlassian.com/browse/CONF-23324>

<https://jira.atlassian.com/browse/CONF-25903>

<https://jira.atlassian.com/browse/CONF-24624>


author: Reto Weiss
body: Do I understand that right:

This issue is related to the usage of "include page" macros.   
There is no known bug with links in exported PDF as long as I don't use include, right?

Thanks a lot.


author: Steffen Heller
body: Cool thing! That is more or less the same I am doing.

The drawback (if you will) is that the anchor links don't work if you go to one of the included pages directly. So either way there is something missing.

The main point for me is that with this approach I can export with one click and I can use the {toc} macro instead of the standard toc and so I can create a toc from headings instead of page names and avoid Confluence's page name limitations, see [Not able to create a page with the same title as another page.](https://answers.atlassian.com/questions/213925/answers/14199837)


author: Christine Rivers
body: I ended up changing my approach. Within a single SPACE, I put all my pages under a page called INCLUDE LIBRARY. Outside of the INCLUDE LIBRARY, but within the same SPACE, I created a single page (let's call it the HOME page) that only had 1) table of contents, and 2) several lines of "Excerpt Include" and "Include Page" of pages and excerpts from the INCLUDE LIBRARY. I still used LINKS and ANCHORS, however I did not use a page reference on the LINKs; only #\<anchorname\>. When the HOME page is viewed, it appears to be a single page. For the PDF export, the only page I had to export was the HOME page. All of the links worked :smile:. YAAAAAAAAAAAAAAY!

comments: author: Reto Weiss
body: The include-approach has some advantages, but also some substantial disadvantages, as far as I can see. The most obvious drawback when it comes to PDF-export is the fact that there are no bookmarks generated, no outline you can use to navigate the PDF. Also the performance is pretty bad, if you include many, maybe hundreds of pages.For me this is a workaround, but not a solution for this issue.