# Bug OP-17221 - Image not visible in PDF export

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-17221

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Export / PDF Export |
| Target versions | 16.5.0 |
| Observed in versions |  |
| Sprint | 16.5.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Andrej Sandorf |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Create a new work package.

2.  Edit the work package description and insert the image *example.png* from your local file system into the description \[a\].

3.  Export PDF - you should see the image displayed in the export.

4.  Enter the work package description edit mode and add a new line "Here comes the same image as before, but it won't show" and add a paragraph at the bottom.

5.  Drag and drop *example.png* from the *Files* tab into the work package description at the bottom \[b\].

6.  Save the work package description - you should now see the image twice. It is the very same file.

7.  Export PDF - the image is only shown once, \[a\] is shown, but \[b\] is not.

### What is the buggy behavior?

Images inserted from local file system are correctly shown in PDF export, but images which were attached to the work package and then added to work package details are not visible in PDF export.

Opening the work package description markdown source reveals that image src path is different.

image \[a\] is linked via API:

``` text
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/1297/content">
```

image \[b\] is "hard-linked":

``` text
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/attachments/1297/example.png"></div></figure>
```

Manually editing image \[b\] src attribute to the API link solves the issue:

``` text
<figure class="image op-uc-figure"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/1297/content"></div></figure>
```

### What is the expected behavior?

Images which have been attached to the work package should be shown in the exported PDF the same way they are shown in the work package details.

### Environment information

**OpenProject installation type**

  - Hosted cloud edition

**Browser**

- [ ] Chrome
- [x] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Operating System**

- [x] Windows
- [ ] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [ ] Linux (please specify distro)
- [ ] Chrome OS
- [ ] Other (please specify)

**Language**

*EN*
