From d71fd089cb9beddfca6e15eb66e09de297f9baae Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Mon, 29 Oct 2018 14:45:59 -0700 Subject: [PATCH] layout: allow names beginning with /i0123 for now Showed up in GGastro2.pdf. Need to check if this pattern has valid Unicode mappings but allow for now. --- src/ocrmypdf/pdfinfo/layout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ocrmypdf/pdfinfo/layout.py b/src/ocrmypdf/pdfinfo/layout.py index ffef6870..4f2d002b 100644 --- a/src/ocrmypdf/pdfinfo/layout.py +++ b/src/ocrmypdf/pdfinfo/layout.py @@ -40,7 +40,7 @@ from ..exceptions import EncryptedPdfError # characters with no corresponding Unicode entry. These can be subsetted fonts # or symbolic fonts. There seems to be no way to map /g123 fonts to Unicode, # barring a ToUnicode data structure. -pdfminer.encodingdb.STRIP_NAME = re.compile(r'[^g][0-9]+') +pdfminer.encodingdb.STRIP_NAME = re.compile(r'(?![g])([0-9]+)') class LTStateAwareChar(LTChar): """A subclass of LTChar that tracks text render mode at time of drawing"""