Exemplo n.º 1
0
        public void Execute(PsContext context, IList <PdfObject> args)
        {
            if (args.Count < 1)
            {
                throw new ArgumentOutOfRangeException(nameof(args));
            }

            if (!(args[0] is PdfArray arr))
            {
                throw new ArgumentException("PsShowTextArray. Argument must be an array");
            }

            foreach (var el in arr)
            {
                switch (el)
                {
                case PdfHexString hexString:
                    var str = context.Decode(hexString.Value);
                    context.DisplayString(str);
                    break;

                case IPdfNumber pdfNumber:
                    var num = pdfNumber.NumberValue;
                    context.ApplyTextAdjust(num);
                    break;

                default:
                    throw new ArgumentException($"PsShowTextArray. Invalid element type {el.GetType()}");
                }
            }
        }
Exemplo n.º 2
0
 public void Execute(PsContext context, IList <PdfObject> args)
 {
     if (args[0] is PdfHexString hexString)
     {
         var str = context.Decode(hexString.Value);
         context.DisplayString(str);
     }
 }