rkusa / pdfjs

A Portable Document Format (PDF) generation library targeting both the server- and client-side.
MIT License
774 stars 142 forks source link

Underline does not seem to work well #325

Open harvey56 opened 6 months ago

harvey56 commented 6 months ago

Underlining text does not seem to work the way it should. The following, as taken from the example :

const cell = doc.cell({ paddingBottom: 0.5 * pdf.cm });
cell.text('Features:', { fontSize: 16, font: fonts.HelveticaBold });
cell
    .text({ fontSize: 14, lineHeight: 1.35 })
    .add('-')
    .add('different', { color: 0xf8dc3f })
    .add('font', { font: fonts.TimesRoman })
    .add('styling', { underline: true })
    .add('options', { fontSize: 9 });

Does not underline the text. It draws an underline before the text.

2024-03-20_11-13