pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

Wrong links through linebreak in table cell

Open jjojok opened this issue 4 years ago • 4 comments

1 2

Hi, so I encountered a bit of an odd issue. It appears if there is a (long) text with link in a table cell and the text is broken to the next line. If you hover over the text there is an area where it links only to a location consisting of the first line and a area where it links to the location as specified with the text's link attribute. Is there maybe a workaround to avoid the incomplete link?

Thanks!

Seen using Acrobat Reader DC 2019.012.20035

var doc = new pdf.Document({ font: fonts.Helvetica })
var table = doc.table({
  widths: [14* pdf.cm]
})
  table.row().cell().text().add('https://some.very/long/link/', {
    link: 'https://some.very/long/link/',
    underline: true,
    color: 0x569cd6,
    fontSize: 40
  })

jjojok avatar Jul 29 '19 10:07 jjojok

Good find! I'll try to look into it this week

rkusa avatar Aug 12 '19 08:08 rkusa

@jjojok tested it and I don't see the issue yet. I've hovered each letter and clicked most parts of the link, and everything is pointing to https://some.very/long/link/ for me (tested on preview and acrobat reader DC on macOS).

Could you open your resulting PDF file in a text editor and search for /URI (. Does on of the search results include an incomplete link? In my case, all search results look like: /URI (https://some.very/long/link/)

rkusa avatar Aug 19 '19 14:08 rkusa

No you are right, there are no incomplete links, just two cases of /URI (https://some.very/long/link/) as one would expect. So this has to be some kind of renderer issue? Thank you for your help anyways!

jjojok avatar Aug 27 '19 13:08 jjojok

So this has to be some kind of renderer issue?

Yes, kinda sounds like a render issue 😕

rkusa avatar Aug 30 '19 08:08 rkusa