mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-06-28 15:30:17 +08:00
Handle SetFlatness operator with no value and fix #682
This commit is contained in:
parent
fe0e4db419
commit
f5b4b84dea
BIN
src/UglyToad.PdfPig.Tests/Integration/Documents/Gamebook.pdf
Normal file
BIN
src/UglyToad.PdfPig.Tests/Integration/Documents/Gamebook.pdf
Normal file
Binary file not shown.
19
src/UglyToad.PdfPig.Tests/Integration/GamebookTests.cs
Normal file
19
src/UglyToad.PdfPig.Tests/Integration/GamebookTests.cs
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -129,6 +129,10 @@ namespace UglyToad.PdfPig.Graphics
|
|||||||
case SetColorRenderingIntent.Symbol:
|
case SetColorRenderingIntent.Symbol:
|
||||||
return new SetColorRenderingIntent((NameToken)operands[0]);
|
return new SetColorRenderingIntent((NameToken)operands[0]);
|
||||||
case SetFlatnessTolerance.Symbol:
|
case SetFlatnessTolerance.Symbol:
|
||||||
|
if (operands.Count == 0)
|
||||||
|
{
|
||||||
|
return null; // Should not happen by definition
|
||||||
|
}
|
||||||
return new SetFlatnessTolerance(OperandToDecimal(operands[0]));
|
return new SetFlatnessTolerance(OperandToDecimal(operands[0]));
|
||||||
case SetLineCap.Symbol:
|
case SetLineCap.Symbol:
|
||||||
return new SetLineCap(OperandToInt(operands[0]));
|
return new SetLineCap(OperandToInt(operands[0]));
|
||||||
|
Loading…
Reference in New Issue
Block a user