Modify

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#3427 closed defect (fixed)

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

Reported by: object01@… Owned by: Diorgenes Felipe Grzesiuk
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 (1)

ticket3427wikiToPdf.png (70.0 KB) - added by object01@… 9 years ago.
Illustrates how Acrobat Reader interprets intra-wiki links.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 9 years ago by Diorgenes Felipe Grzesiuk

Status: newassigned

comment:2 Changed 9 years ago by Diorgenes Felipe Grzesiuk

Resolution: fixed
Status: assignedclosed

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

comment:3 in reply to:  2 ; Changed 9 years ago by object01@…

Resolution: fixed
Status: closedreopened

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

Changed 9 years ago by object01@…

Attachment: ticket3427wikiToPdf.png added

Illustrates how Acrobat Reader interprets intra-wiki links.

comment:4 Changed 9 years ago by object01@…

See the attached screenshot for an illustration of this problem.

comment:5 in reply to:  3 ; Changed 9 years ago by Diorgenes Felipe Grzesiuk

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

comment:6 in reply to:  5 Changed 9 years ago by object01@…

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 
[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

comment:7 Changed 9 years ago by object01@…

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

comment:8 in reply to:  7 ; Changed 9 years ago by Diorgenes Felipe Grzesiuk

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

comment:9 in reply to:  8 Changed 9 years ago by Diorgenes Felipe Grzesiuk

Resolution: fixed
Status: reopenedclosed
Trac Release: 0.100.11

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Diorgenes Felipe Grzesiuk.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.