From dc1e42293e7774353003b754cce9c64dd9546c2d Mon Sep 17 00:00:00 2001 From: Connum Date: Thu, 29 Oct 2020 21:59:50 +0100 Subject: [PATCH] hotfix for #359 and #360: fallback for glyphs not in the postscript lookup table (#362) * hotfix for #359 and #360: fallback for glyphs not in the postscript lookup table * test comment and assertion: actually just one character being decoded incorrectly * added @todo keyword to test case comment so we can keep track of this * moved comment before code as requested in the review * fix code linting --- samples/bugs/Issue359.pdf | Bin 0 -> 16699 bytes .../PdfParser/Encoding/PostScriptGlyphs.php | 8 +++++- tests/Integration/ParserTest.php | 23 ++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 samples/bugs/Issue359.pdf diff --git a/samples/bugs/Issue359.pdf b/samples/bugs/Issue359.pdf new file mode 100644 index 0000000000000000000000000000000000000000..69276b9d63935c3d38be65261ad372a2190ea1d3 GIT binary patch literal 16699 zcmcJ%1z1$y+BPmIAt5aSf&&a9Im`eaacZZZT2na)ifRqRl z(tLxz@_5dB-v4)9-+!(R*NXeOS3P^L;oj?k?y0yW3z(Gymu}_r$T%(*7{CUwGq%Fz z=Le~I*uy|ijm&R;Il^q60bmYfr3y&Q&ej>3bpn9df94fnrj|yccJ8`t$SfxhCxDv+ zq6boeIoY{5n!ucpOivx{OjKdcx*%j@AT^k~vmQvo-C0W2*~l4&tXAOyKyH`>1woQX z?wb+_81M(V3Iqb+{Mn2Oga^R$2TTz8!G+nH-gNZF^4AXkO$<_cssI501H9q;6?oGW zNY%yI`DU0mV+DgmjhtXVi=|<3SD3S(FOK%CI0T5 znvR;ff*O;Eqoom?S;pB2ZfOFNv~+ZG7PByN1b{*EMt>&Re@>@3%*n*j(%#w55dcLt zqykd2Q@6E5js^zc{+ZXbG^^{tlkI0al9q571i*DOuzx1_Ci~|ghdu1qQ>(Y!2B$=uz4*`CNZ5G)L(lj<2kaAP$@Quy$*| zE+%chCePdn#~=+AK&97G+rsiVfAiMn`Bb&d?kk)3-!R)U6Sfp=ta&9@5K_$V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91a{(H67E_p+kqg|JM)2mo<_F#Q4ct=jkHk+K&@W6s zX`OE#4}Wlpz@7g)>2D8_-}rx;-|+uI`E#fW3cTWWCN4LACL=EB;$msaYieY~&B+Zh zVKL@0=3!wsGl8)1aIl-QaI%@2fgxsWMqnP!pELKbwtvxSz#N^Bw*-<6{1@tMz%->HNWD5c`Za2>o zWa_sQm+p=*Gh8+Rm>ZYv?+*aV$;r+MFvG?AtLWyze)9p?{#^#assertStringContainsString('This question already has an answer here', $document->getText()); } + + /** + * Test that issue related pdf can now be parsed: + * Glyphs not in the Postscript lookup table would cause "Notice: Undefined offset" + * + * @see https://github.com/smalot/pdfparser/issues/359 + */ + public function testIssue359() + { + $filename = $this->rootDir.'/samples/bugs/Issue359.pdf'; + + $document = $this->fixture->parseFile($filename); + + $this->assertStringContainsString('dnia 10 maja 2018 roku o ochronie danych osobowych', $document->getText()); + $this->assertStringContainsString('sprawie ochrony osób fizycznych w związku', $document->getText()); + /* + * @todo Note that the "ł" in przepływu is decoded as a space character. This was already + * the case before the PR that caused this issue and is not currently covered by this + * test case. However, this issue should be addressed in the future and its fix can then + * be incorporated into this test by uncommenting the following assertion. + */ + // $this->assertStringContainsString('sprawie swobodnego przepływu takich danych oraz uchylenia dyrektywy', $document->getText()); + } } class ParserSub extends Parser