Opened 9 years ago

# Linked images in PDF don't work properly

Reported by: Owned by: anonymous Diorgenes Felipe Grzesiuk high TracWikiToPdfPlugin major image, link 0.11

### Description

In the PDF the links on images should be improved, with one enhancement and one defect-fix:

## Enhancement

In the Wiki-output, the links point to the raw attachment (raw-attachment/wiki/[page name]/[image name]. In this case, it would be better to link to the "attachment page" in the wiki (attachment/wiki/[page name]/[image name]) so that the image is viewed in context and in the browser rather than having to be downloaded and saved or viewed with a local image editor.

## Defect fix

Additionally, in single-page output, the links on images point to wiki/[image name] rather than attachment/wiki/[page name]/[image name] and so clicking on the image in the PDF gets a "describe [image name]" page rather than the image. This should behave as for wiki output (with the suggested enhancement!).

### comment:1 Changed 9 years ago by romainguinot@…

I have patched wikitopdf.py to fix embedded image and links in PDF files. Unfortunately,

It seems i can't add it here :

Submission rejected as potential spam (Content contained these blacklisted patterns: '(?i)<a. href=')

If there is another way i can add it, let me know. I could substitute all h.ref in the patch with hfakeref but it's not ideal.

### comment:2 Changed 6 years ago by Ryan J Ollos

#6182 closed as a duplicate.

### comment:3 Changed 6 years ago by Ryan J Ollos

#6966 closed as a duplicate.

### comment:4 Changed 6 years ago by Ryan J Ollos

(In [11471]) Refs #4043: Pass resource and id to the context, which seems to solve the issue that images require the realm and id to be specified (i.e. [[Image(wiki:WikiStart:myfile.png)]] worked, but [[Image(myfile.png)]] didn't.)

### comment:5 Changed 6 years ago by Ryan J Ollos

(In [11507]) Refs #4043, #6243:

• Removed some needed imports in [11469].
• When wiki page is created from the Admin panel, the page variables in not passed as a argument in the request. We'll have to find some other way to get it.

### Modify Ticket

Change Properties