Why does copied PDF text differ from the page?
By Anton Samper · Reviewed
This invoice shows £1,250.00 on the page, but Poppler's pdftotext extracts £9,250.00. The font has a deliberately incorrect Unicode mapping. Follow its references to find the entry responsible.
Open this exampleDownload sample PDF
1. Compare appearance with extraction
Open the example's page preview to check the amount, then download the PDF and extract its text outside the inspector:
pdftotext incorrect-unicode.pdf -With Poppler installed, this command produces a line containing Invoice total: £9,250.00. Readers and extractors may use different fallbacks, so clipboard behaviour can vary. PDF Internals can search page text. Its decoded stream view shows the underlying instructions and font encoding, not a full extraction.

2. Find the text instruction
Choose First page, follow /Contents to 4 0 R, then select Decoded → Decoded byte text. The amount is written as:
BT /F1 24 Tf 72 564 Td (Invoice total: \2431,250.00) Tj ET/F1 24 Tf selects font resource F1 at size 24. The literal string contains the digit 1, whose code is hexadecimal 31. The octal escape \243 supplies the pound sign's code in this font's WinAnsi encoding. These are drawing instructions containing character codes; extraction still has to map those codes to Unicode.
3. Follow the font to its Unicode map
Return to page 3 0 R. Follow /Resources → /Font → /F1 to font 5 0 R. It names Helvetica and /WinAnsiEncoding, which supply the visible glyphs here. Its /ToUnicode reference points to 6 0 R. Open that stream's Decoded tab and find the entry inside beginbfchar:
<31> <0039>This maps source code 31 (the visible digit 1) to Unicode U+0039 (the digit 9). For this sample, the intended mapping is <31> <0031>. The incorrect entry changes the extracted amount while leaving the visible glyph unchanged.
What to change in the generator
Correct the Unicode map in the generating software, regenerate the PDF, and verify both rendering and extraction. Removing a map is not a general fix: other fonts may need it to extract meaningful text at all.
If you process invoices automatically, a readable page alone does not establish that the extracted amount is correct. Missing spaces, reading order, scanned pages, and absent mappings need separate investigations. PDF Internals does not repair mappings or validate an extraction pipeline.