implement the show text with positioning operator, fix bugs with parsing stream lengths contained in indirect objects. fix bug with parsing font dictionaries contained in indirect objects.

This commit is contained in:
Eliot Jones
2017-12-31 14:11:13 +00:00
parent 33c628e0c8
commit a77e8e1a56
14 changed files with 268 additions and 55 deletions

View File

@@ -61,6 +61,20 @@ namespace UglyToad.Pdf.Graphics
{
throw new InvalidOperationException($"Tried to create a show text operation with operand type: {operands[0]?.GetType().Name ?? "null"}");
}
case ShowTextsWithPositioning.Symbol:
if (operands.Count == 0)
{
throw new InvalidOperationException("Cannot have 0 parameters for a TJ operator.");
}
if (operands.Count == 1 && operands[0] is ArrayToken arrayToken)
{
return new ShowTextsWithPositioning(arrayToken.Data);
}
var array = operands.ToArray();
return new ShowTextsWithPositioning(array);
}
if (!operations.TryGetValue(op.Data, out Type operationType))