pdfminer.six
pdfminer.six copied to clipboard
Character and word spacing (Tc and Tw parameters) should also apply at end of strings
The way character spacing (PDF 2.0 section 9.3.2) is applied is needlessly complex and also incorrect in pdfminer.six. Instead of applying spacing between the glyphs in a single text-showing operator, it should simply apply it to the glyph displacement, such that it "carries over" to the next text-showing operator.
For this PDF: character_spacing.pdf
pdfminer.six (in PDFTextDevice.render_string_horizontal) will currently do something like this:
when it should do this:
(this is also true for word spacing but it appears that pdfminer.six does that correctly)