OpenPDF icon indicating copy to clipboard operation
OpenPDF copied to clipboard

letter-spacing not respected by openpdf-html

Open elduffy opened this issue 6 months ago • 3 comments

Describe the bug

The letter-spacing html style is not respected in the PDF output from openpdf-html

To Reproduce

See the minimal test here. It generates output using librepdf as well as openhtmltopdf for comparison. The latter correctly applies spacing in the generated html.

Expected behavior/Screenshots

The actual output is spaced as if the letter-spacing is not present: Image

The expected output, as generated by openhtmltopdf: Image

System

(please complete the following information)

  • OS: iOS
  • Used font: left as default
  • OpenPDF version: Reproduced on 3.0.0, 2.4.0, and 2.2.4

Your real name

Eric Duffy

elduffy avatar Aug 18 '25 22:08 elduffy

I tested LetterSpacingTest.kt on https://github.com/flyingsaucerproject/flyingsaucer and letter-spacing is not respected by flyingsaucer either. OpenPDF is forked from flyingsaucer. This means that at least this bug isn't some new bug which was created in openpdf-html, in the fork process.

Pull requests for this is welcome!

andreasrosdal avatar Aug 19 '25 06:08 andreasrosdal

Maybe we can find out how openhtmltopdf does this. However, openhtmltopdf is pdfbox based.

Flyingsaucer 9.0.0 with iText 2.1.7 doesn't apply letter-spacing either, in the LetterSpacingTest.kt test.

andreasrosdal avatar Aug 19 '25 06:08 andreasrosdal

Also see https://github.com/flyingsaucerproject/flyingsaucer/issues/356

andreasrosdal avatar Aug 19 '25 06:08 andreasrosdal