mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
try handling malformed operators where operands are not provided #355
This commit is contained in:
parent
2df5ec9b10
commit
a3e316958a
@ -20,7 +20,7 @@ namespace UglyToad.PdfPig.Graphics
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Tokens;
|
||||
using UglyToad.PdfPig.Graphics.Operations.PathPainting;
|
||||
using Operations.PathPainting;
|
||||
|
||||
internal class ReflectionGraphicsStateOperationFactory : IGraphicsStateOperationFactory
|
||||
{
|
||||
@ -271,8 +271,18 @@ namespace UglyToad.PdfPig.Graphics
|
||||
throw new InvalidOperationException($"Tried to create a move to next line and show text operation with operand type: {operands[0]?.GetType().Name ?? "null"}");
|
||||
}
|
||||
case MoveToNextLineWithOffset.Symbol:
|
||||
if (operands.Count < 2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new MoveToNextLineWithOffset(OperandToDecimal(operands[0]), OperandToDecimal(operands[1]));
|
||||
case MoveToNextLineWithOffsetSetLeading.Symbol:
|
||||
if (operands.Count < 2)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new MoveToNextLineWithOffsetSetLeading(OperandToDecimal(operands[0]), OperandToDecimal(operands[1]));
|
||||
case PaintShading.Symbol:
|
||||
return new PaintShading((NameToken)operands[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user