danfickle / danfickle/openhtmltopdf

Issue with embedded file attachments

Open
#976 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.2k
Forks
423
PR merge metrics
No merged PRs in 30d

Description

I have implemented a "custom resource access controller" as described on https://github.com/danfickle/openhtmltopdf/wiki/Embedding-downloadable-files#java

My HTML looks like this:
```html

Some attachment link

```

The resulting PDF contains
```
65 0 obj
<<
/Type /Filespec
/EF 109 0 R
/F (Some_attachment.docx)
/UF (Some_attachment.docx)
/AFRelationship /Source
/Desc (Some attachment.docx)
>>
endobj
```

The attachment link in the document works, but my PDF viewer (Xreader 3.6.6) does not show the proper filename in the "annotations" panel. It only shows "(null)". The "attachments" panel is empty.

![image](https://github.com/user-attachments/assets/2c2ae9f9-6710-47a4-9bba-be0f09a56421)

I have tried different values for the `download`, `data-content-type` and `relationship`, but did not succeed.

I have read through the code at https://github.com/danfickle/openhtmltopdf/blob/780ba564839f1ad5abfa5df12e4aebb9dd6782d2/openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PdfBoxFastLinkManager.java#L301-L381 but didn't find anything.

Any ideas about what I am doing wrong?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.