diff --git a/src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs b/src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs index 4ecf25168..edf563b60 100644 --- a/src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs +++ b/src/UglyToad.PdfPig.Tests/Integration/GithubIssuesTests.cs @@ -11,6 +11,18 @@ public class GithubIssuesTests { + [Fact] + public void Issues1332() + { + var path = IntegrationHelpers.GetSpecificTestDocumentPath("color_icc_based.pdf"); + using (var document = PdfDocument.Open(path, new ParsingOptions() { UseLenientParsing = true })) + { + var page = document.GetPage(1); + Assert.NotNull(page); + Assert.NotEmpty(page.Paths); + } + } + [Fact] public void Issues1328() { @@ -29,7 +41,7 @@ public void Issues1328() Assert.Equal(187334, images2[0].RawBytes.Length); } } - + [Fact] public void Issues1237() { diff --git a/src/UglyToad.PdfPig.Tests/Integration/SpecificTestDocuments/color_icc_based.pdf b/src/UglyToad.PdfPig.Tests/Integration/SpecificTestDocuments/color_icc_based.pdf new file mode 100644 index 000000000..fd9930d59 Binary files /dev/null and b/src/UglyToad.PdfPig.Tests/Integration/SpecificTestDocuments/color_icc_based.pdf differ diff --git a/src/UglyToad.PdfPig.Tokenization/PlainTokenizer.cs b/src/UglyToad.PdfPig.Tokenization/PlainTokenizer.cs index 5019eda8c..427dfd2a9 100644 --- a/src/UglyToad.PdfPig.Tokenization/PlainTokenizer.cs +++ b/src/UglyToad.PdfPig.Tokenization/PlainTokenizer.cs @@ -6,7 +6,7 @@ internal sealed class PlainTokenizer : ITokenizer { - public bool ReadsNextByte { get; } = true; + public bool ReadsNextByte => true; public bool TryTokenize(byte currentByte, IInputBytes inputBytes, out IToken token) { @@ -20,7 +20,7 @@ public bool TryTokenize(byte currentByte, IInputBytes inputBytes, out IToken tok using var builder = new ValueStringBuilder(stackalloc char[16]); builder.Append((char)currentByte); - + while (inputBytes.MoveNext()) { if (ReadHelper.IsWhitespace(inputBytes.CurrentByte)) @@ -28,12 +28,12 @@ public bool TryTokenize(byte currentByte, IInputBytes inputBytes, out IToken tok break; } - if (inputBytes.CurrentByte is (byte)'<' or (byte)'[' or (byte)'/' or (byte)']' or (byte)'>' or (byte)'(' or (byte)')') + if (inputBytes.CurrentByte is (byte)'<' or (byte)'[' or (byte)'/' or (byte)']' or (byte)'>' or (byte)'(' or (byte)')' or (byte)'%') { break; } - builder.Append((char) inputBytes.CurrentByte); + builder.Append((char)inputBytes.CurrentByte); } var text = builder.AsSpan();