danfickle / openhtmltopdf

An HTML to PDF library for the JVM. Based on Flying Saucer and Apache PDF-BOX 2. With SVG image support. Now also with accessible PDF support (WCAG, Section 508, PDF/UA)!
https://danfickle.github.io/pdf-templates/index.html
Other
1.93k stars 360 forks source link

Multiple Footnote Marker to same footnote on page #908

Open Joniras opened 1 year ago

Joniras commented 1 year ago

I've got a page that has multiple footnote references that need to go to the same footnote at the bottom of the page.

Something like this:

<div class="footnote">This is my first footnote</div>
  Lorem ipsum...
<div class="footnote">Second <strong>footnote</strong>!</div>
  Dolor sit amet...
  <!--This is a reference to the same footnote as the first footnote -->
<div class="footnote-marker-1"></div>

Which should result in something like this:

image

Is there any option to do that?

Joniras commented 1 year ago

I actually got it somehow working by accident:

  Lorem ipsum...
<div class="footnote" id="f-1">This is my first footnote</div><br/>
  Lorem ipsum...
<div class="footnote">Second <strong>footnote</strong>!</div><br/>
  Dolor sit amet...
  <!--This is a reference to the same footnote as the first footnote -->
<a href="#f-1">[1]</a>

Just left it here so other people find it.

Leaving it open so it is maybe added to the wiki.