Ticket #3427 (closed defect: fixed)

Opened 7 months ago

Last modified 3 months ago

Intra-wiki links treated as local OS links by Acrobat Reader

Reported by: object01@gmail.com Assigned to: diorgenes
Priority: normal Component: TracWikiToPdfPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

When rendering a wiki page to PDF, links to other pages within the wiki (i.e. /myTrac/wiki/myWikiPage) are not reformatted in any way, causing Acrobat Reader to interpret those links as relative to the OS temporary folder of the user viewing the PDF (i.e. on Windows, C:\Users\Me\AppData?\Local\Temp\myWikiPage).

Recommend reformatting intra-wiki links using absolute URLs (i.e. /myTrac/wiki/myWikiPage -> http://www.allMyTracs.com/myTrac/wiki/myWikiPage) so that Adobe Acrobat Reader correctly interprets the link.

Attachments

ticket3427wikiToPdf.png (70.0 kB) - added by object01@gmail.com on 07/21/08 18:58:37.
Illustrates how Acrobat Reader interprets intra-wiki links.

Change History

07/21/08 17:56:34 changed by diorgenes

  • status changed from new to assigned.

(follow-up: ↓ 3 ) 07/21/08 18:15:03 changed by diorgenes

  • status changed from assigned to closed.
  • resolution set to fixed.

Hi, good morning!

This option is configurable. The trac.ini contains this option file. You can remove it or add other... These settings are parameters of HTMLDOC to generate PDF files.

Example:

[wikitopdf-admin]
no-links = None /* erase */
linkstyle = plain 

[wikitopdf-page]
no-links = None /* erase */
linkstyle = plain

(in reply to: ↑ 2 ; follow-up: ↓ 5 ) 07/21/08 18:52:35 changed by object01@gmail.com

  • status changed from closed to reopened.
  • resolution deleted.

I think you misunderstand: the no-links option determines whether links are included at all, not how they're formatted.

I had already erased no-links because I wanted my PDF to include links. It was after erasing no-links that I observed the bug.

Replying to diorgenes:

Hi, good morning! This option is configurable. The trac.ini contains this option file. You can remove it or add other... These settings are parameters of HTMLDOC to generate PDF files. Example: {{{ [wikitopdf-admin] no-links = None /* erase */ linkstyle = plain [wikitopdf-page] no-links = None /* erase */ linkstyle = plain }}}

07/21/08 18:58:37 changed by object01@gmail.com

  • attachment ticket3427wikiToPdf.png added.

Illustrates how Acrobat Reader interprets intra-wiki links.

07/21/08 19:00:08 changed by object01@gmail.com

See the attached screenshot for an illustration of this problem.

(in reply to: ↑ 3 ; follow-up: ↓ 6 ) 07/21/08 19:19:04 changed by diorgenes

OK, sorry...

Here is running ... I tested in the windows and linux using IE and firefox with acrobat reader...

As you are making the Wiki links?

TracGuide 
[wiki:TracGuide]

Replying to object01@gmail.com:

I think you misunderstand: the no-links option determines whether links are included at all, not how they're formatted. I had already erased no-links because I wanted my PDF to include links. It was after erasing no-links that I observed the bug. Replying to diorgenes:

Hi, good morning! This option is configurable. The trac.ini contains this option file. You can remove it or add other... These settings are parameters of HTMLDOC to generate PDF files. Example: {{{ [wikitopdf-admin] no-links = None /* erase */ linkstyle = plain [wikitopdf-page] no-links = None /* erase */ linkstyle = plain }}}

(in reply to: ↑ 5 ) 07/21/08 19:43:17 changed by object01@gmail.com

I typically use [wiki:TracGuide a guide for Trac] notation.

I wonder if this has to do with hosting Trac using the "multiple environments" mode, i.e. tracd -e?

Consider the attached screenshot: that PDF was generated from a page having URL http://myCompany.com:8000/jupiter/wiki/sandbox. The DEBUG log reveals:

2008-07-21 11:55:13,134 Trac[wikitopdf] DEBUG: WikitoPDF => Html code:
'<p>\r\nDemonstrating an intra-wiki link problem with the WikiToPdf plugin.\r\n</p>
\r\n<p>\r\n<a class="wiki" href="/jupiter/wiki/WikiStart">This link</a> links to the start page.\r\n</p>\r\n'

"jupiter" is the name of the Trac environment I was using at the time. We host multiple Trac environments (jupiter, saturn, earth, etc.) using tracd -e off a single root:

D:\ourTracs
D:\ourTracs\jupiter
D:\ourTracs\saturn
D:\ourTracs\earth

So, for example, we're hosting all Trac environments at once using tracd -e \ourTracs.

Replying to diorgenes:

OK, sorry... Here is running ... I tested in the windows and linux using IE and firefox with acrobat reader... As you are making the Wiki links? {{{ TracGuide TracGuide }}} Replying to object01@gmail.com:

I think you misunderstand: the no-links option determines whether links are included at all, not how they're formatted. I had already erased no-links because I wanted my PDF to include links. It was after erasing no-links that I observed the bug. Replying to diorgenes:

Hi, good morning! This option is configurable. The trac.ini contains this option file. You can remove it or add other... These settings are parameters of HTMLDOC to generate PDF files. Example: {{{ [wikitopdf-admin] no-links = None /* erase */ linkstyle = plain [wikitopdf-page] no-links = None /* erase */ linkstyle = plain }}}

(follow-up: ↓ 8 ) 07/21/08 19:56:25 changed by object01@gmail.com

Looking at the PDF's bits, it appears that intra-wiki links are being encoded by HtmlDoc? like so:

27 0 obj<</S/Launch/F(WikiStart)>>endobj

This causes Acrobat Reader to attempt to launch the file named "WikiStart", which of course doesn't exist on the user's machine.

That means that HtmlDoc? is likely truncating the beginning of all relative URLs, eliminating all path information and leaving only the name of the page, i.e. /jupiter/wiki/WikiStart -> WikiStart.

I think that in Wiki2PdfPage "mode" (as opposed to Wiki2PdfAdmin "mode"), relative links should be expanded to fully-qualified URLs, i.e. /jupiter/wiki/WikiStart -> http://myTracs.com/jupiter/wiki/WikiStart, so that HtmlDoc? encodes the link in the PDF like so:

27 0 obj<</S/URI/URI(http://myTracs.com/jupiter/wiki/WikiStart)>>endobj

(in reply to: ↑ 7 ; follow-up: ↓ 9 ) 07/21/08 20:10:55 changed by diorgenes

I was opening the PDF directly without saving it.

I will provide these changes ...

Replying to object01@gmail.com:

Looking at the PDF's bits, it appears that intra-wiki links are being encoded by HtmlDoc? like so: {{{ 27 0 obj<</S/Launch/F(WikiStart)>>endobj }}} This causes Acrobat Reader to attempt to launch the file named "WikiStart", which of course doesn't exist on the user's machine. That means that HtmlDoc? is likely truncating the beginning of all relative URLs, eliminating all path information and leaving only the name of the page, i.e. /jupiter/wiki/WikiStart -> WikiStart. I think that in Wiki2PdfPage "mode" (as opposed to Wiki2PdfAdmin "mode"), relative links should be expanded to fully-qualified URLs, i.e. /jupiter/wiki/WikiStart -> http://myTracs.com/jupiter/wiki/WikiStart, so that HtmlDoc? encodes the link in the PDF like so: {{{ 27 0 obj<</S/URI/URI(http://myTracs.com/jupiter/wiki/WikiStart)>>endobj }}}

(in reply to: ↑ 8 ) 08/21/08 22:06:04 changed by diorgenes

  • release changed from 0.10 to 0.11.
  • status changed from reopened to closed.
  • resolution set to fixed.

Replying to diorgenes:

I was opening the PDF directly without saving it. I will provide these changes ... Replying to object01@gmail.com:

Looking at the PDF's bits, it appears that intra-wiki links are being encoded by HtmlDoc? like so: {{{ 27 0 obj<</S/Launch/F(WikiStart)>>endobj }}} This causes Acrobat Reader to attempt to launch the file named "WikiStart", which of course doesn't exist on the user's machine. That means that HtmlDoc? is likely truncating the beginning of all relative URLs, eliminating all path information and leaving only the name of the page, i.e. /jupiter/wiki/WikiStart -> WikiStart. I think that in Wiki2PdfPage "mode" (as opposed to Wiki2PdfAdmin "mode"), relative links should be expanded to fully-qualified URLs, i.e. /jupiter/wiki/WikiStart -> http://myTracs.com/jupiter/wiki/WikiStart, so that HtmlDoc? encodes the link in the PDF like so: {{{ 27 0 obj<</S/URI/URI(http://myTracs.com/jupiter/wiki/WikiStart)>>endobj }}}

Hi

I added this functionality. Verify new version the plugin (2.2).

You are going to need more two parameters in trac.ini file.

[wikitopdf]
# this are parameters functionality PDF links
link = http://servername/trac-project
folder_name = trac-project

Regards

Diorgenes F. Grzesiuk


Add/Change #3427 (Intra-wiki links treated as local OS links by Acrobat Reader)




Change Properties
Action