Skip to content

Commit

Permalink
Handle SetFlatness operator with no value and fix #682
Browse files Browse the repository at this point in the history
  • Loading branch information
BobLd committed Oct 18, 2023
1 parent fe0e4db commit f5b4b84
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Binary file not shown.
19 changes: 19 additions & 0 deletions src/UglyToad.PdfPig.Tests/Integration/GamebookTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace UglyToad.PdfPig.Tests.Integration
{
using Xunit;

public class GamebookTests
{
[Fact]
public void Issue682()
{
using (var document = PdfDocument.Open(IntegrationHelpers.GetDocumentPath("Gamebook.pdf")))
{
foreach (var page in document.GetPages())
{
Assert.NotNull(page);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ public IGraphicsStateOperation Create(OperatorToken op, IReadOnlyList<IToken> op
case SetColorRenderingIntent.Symbol:
return new SetColorRenderingIntent((NameToken)operands[0]);
case SetFlatnessTolerance.Symbol:
if (operands.Count == 0)
{
return null; // Should not happen by definition
}
return new SetFlatnessTolerance(OperandToDecimal(operands[0]));
case SetLineCap.Symbol:
return new SetLineCap(OperandToInt(operands[0]));
Expand Down

0 comments on commit f5b4b84

Please sign in to comment.