pdfmake icon indicating copy to clipboard operation
pdfmake copied to clipboard

Pdfmake splits links into many small chunks

Open rluba opened this issue 4 years ago • 1 comments

If you declare a simple content like [{text: 'Some text with words, link: 'http://localhost'}] pdfmake does not create a single link around the whole text. Instead it creates a link for every single word in the text.

This has undesired consequences. For example, Firefox highlights link when you hover over them. But instead of showing the whole text as a link, every single word appears as a separate link: Link highlighting in Firefox

I had a look at the source code and the fundamental problem seems to be that pdfmake splits every string at the very beginning into its words, copying all information from the whole object onto its parts. It thereby destroys any info about what elements should be linked and can’t re-create that information later on.

rluba avatar Sep 30 '21 08:09 rluba

Any solution for this?

luizbills avatar Oct 10 '23 10:10 luizbills