danfickle / danfickle/openhtmltopdf

Creating anchor link to merged PDF attachment

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

Description

Hi!

I'm using OpenHtmlToPdf to generate PDF's from HTML (duh). However, I also need to be able to handle attachments, that is, other PDF's that I will append to the end of the generated document. We fetch these PDF's from a user specified url. This works fine using `PdfMergerUtility` from PDFBox.

The last page before the appended PDF's will be an overview of the attachments, a table with document titles and number of pages. I want to turn the document titles into anchor links, so that when a user clicks it, it takes them to the correct page for that appended attachment.

For the genereted PDF, we simply use `` to create anchor links. How can I get this link to point to a specific page in the final document? Or is there a way I can append the attachments using "only" html, like:

```
link to attachment 1

```

How would you solve this issue? :)

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.