mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-14 02:44:58 +08:00
fix bug with endstream appearing without line break
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using IO;
|
||||
using PdfPig.ContentStream;
|
||||
using PdfPig.Tokenization.Scanner;
|
||||
using PdfPig.Tokenization.Tokens;
|
||||
using PdfPig.Util;
|
||||
using Xunit;
|
||||
|
||||
public class PdfTokenScannerTests
|
||||
@@ -294,8 +296,9 @@ endobj
|
||||
<< /S 1245 >>
|
||||
|
||||
stream
|
||||
%¥×³®í»š}%§X{{tøNåÝž¶ö¢ÖÞgrehtyyy$&%&£$££(*¾–~´¼
|
||||
endstream
|
||||
endstream
|
||||
endobj";
|
||||
|
||||
var scanner = GetScanner(s);
|
||||
|
||||
|
@@ -214,16 +214,9 @@
|
||||
|
||||
// We are reading 'end' (possibly).
|
||||
if (commonPartPosition < commonPart.Length && inputBytes.CurrentByte == commonPart[commonPartPosition])
|
||||
{
|
||||
if (commonPartPosition == 0 && !ReadHelper.IsWhitespace(previousByte))
|
||||
{
|
||||
// We've just encountered a normal 'e' in the stream.
|
||||
}
|
||||
else
|
||||
{
|
||||
commonPartPosition++;
|
||||
}
|
||||
}
|
||||
else if (commonPartPosition == commonPart.Length)
|
||||
{
|
||||
// We are reading 'stream' after 'end'
|
||||
|
Reference in New Issue
Block a user