Opened 10 years ago

Closed 10 years ago

## #3427 closed defect (fixed)

Reported by: Owned by: object01@… Diorgenes Felipe Grzesiuk normal TracWikiToPdfPlugin normal 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).

### comment:1 Changed 10 years ago by Diorgenes Felipe Grzesiuk

Status: new → assigned

### comment:2 follow-up:  3 Changed 10 years ago by Diorgenes Felipe Grzesiuk

Resolution: → fixed assigned → closed

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 */

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


### comment:3 in reply to:  2 ; follow-up:  5 Changed 10 years ago by object01@…

Resolution: fixed closed → reopened

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.

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 */

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


### comment:4 Changed 10 years ago by object01@…

See the attached screenshot for an illustration of this problem.

### comment:5 in reply to:  3 ; follow-up:  6 Changed 10 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]


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.

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 */

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


### comment:6 in reply to:  5 Changed 10 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>


"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.

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]


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.

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 */

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


### comment:7 follow-up:  8 Changed 10 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 ; follow-up:  9 Changed 10 years ago by Diorgenes Felipe Grzesiuk

I was opening the PDF directly without saving it.

I will provide these changes ...

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 10 years ago by Diorgenes Felipe Grzesiuk

Resolution: → fixed reopened → closed 0.10 → 0.11

I was opening the PDF directly without saving it.

I will provide these changes ...

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
folder_name = trac-project


Regards

Diorgenes F. Grzesiuk

### Modify Ticket

Change Properties