I missed a rendering change (sorry) in the linked PDF.js issue that happened in
PDFBOX-4810 but it is not a regression, rather a difference in displaying a bad input due to having different data.
The CMap has these ranges:
The content stream has segments like
0340 is 0xE0. The current code at CMap.readCode() reads bytes until a range fits, and this means it reads 4 bytes until it noticed that this has failed. After the failure it doesn't reposition. So this is displayed as "Check ·Date" instead of "Check -up Date", i.e. input is lost. The "·" is the default glyph.
The solution is to remember the position and to reposition there. I'm using mark() and reset() which, surprisingly, works both when loading in memory and when loading with temp file.