ivmarcos/react-to-pdf

Possibility to create a menu with links inside a pdf using <a> tags

lawrenz1337 opened this issue · 1 comments

https://react-pdf.org/advanced#destinations

React-pdf has such ability to target a specific #target element in the document and when you click it you will get scrolled down to it.

I am not sure if I can achieve the same thing using this library, can anyone elaborate?

    <Page>
      <a href='#Footnote'>
        Click me to get to the footnote
      </a>

      // Other content here

      <div id='Footnote'>
        You are here because you clicked the link above
      </div>
    </Page>

Hi @lawrenz1337, react-to-pdf works essentially by generating a canvas from the element with html2canvas to then include the image data in the PDF file, so this won't work here,.

As mentioned in the readme:

Not vectorized - the pdf is created from a screenshot of the component and therefore is not vectorized. If you are looking for something more advanced to generate pdf using React components, please check out other popular alternatives packages listed below.