From 4693588a5f289407b0798ef8bf7a85b78007e934 Mon Sep 17 00:00:00 2001 From: Gunnsteinn Hall Date: Mon, 9 Jan 2017 22:00:26 +0000 Subject: [PATCH] Fix for stream delimiting --- pdf/core/parser.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdf/core/parser.go b/pdf/core/parser.go index de8528a8..3e233a00 100644 --- a/pdf/core/parser.go +++ b/pdf/core/parser.go @@ -1211,7 +1211,9 @@ func (this *PdfParser) ParseIndirectObject() (PdfObject, error) { if string(bb[:6]) == "stream" { discardBytes := 6 if len(bb) > 6 { - if IsWhiteSpace(bb[discardBytes]) { + if IsWhiteSpace(bb[discardBytes]) && bb[discardBytes] != '\r' && bb[discardBytes] != '\n' { + // If any other white space character... should not happen! + // Skip it.. common.Log.Debug("Non-conformant PDF not ending stream line properly with EOL marker") discardBytes++ }