From a7fd2fb82ff22510ccddc5a6b8789a7f9b20fa12 Mon Sep 17 00:00:00 2001 From: Jason Crain Date: Sat, 30 Jul 2016 03:38:29 -0500 Subject: [PATCH] Remove null characters from PDF text Null characters in the PDF text cause problems with the glib frontend's handling of C strings. Filter them out. Bug #97144 --- poppler/TextOutputDev.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc index cf39bd8..56ea3cc 100644 --- a/poppler/TextOutputDev.cc +++ b/poppler/TextOutputDev.cc @@ -2611,6 +2611,10 @@ void TextPage::addChar(GfxState *state, double x, double y, charPos += nBytes; endWord(); return; + } else if (uLen == 1 && u[0] == (Unicode)0x0) { + // ignore null characters + charPos += nBytes; + return; } state->getFontTransMat(&mat.m[0], &mat.m[1], &mat.m[2], &mat.m[3]); -- 2.8.1