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