Ejemplo n.º 1
0
        internal override void Write(PdfStreamWriter writer)
        {
            writer.SetState(State);
            writer.WriteLine("BT");
            writer.WriteLine($"    /F{Font.FontId} {FontSize.AsPoints().AsFixed()} Tf");
            writer.WriteLine($"    {Location} Td");
            if (CharacterWidth.RawValue != 0.0)
            {
                writer.WriteLine($"    {CharacterWidth.AsPoints().AsFixed()} Tc");
            }

            writer.Write("    [(");
            foreach (var c in Value)
            {
                switch (c)
                {
                case '(':
                case ')':
                case '\\':
                    writer.Write((byte)'\\');
                    break;
                }

                writer.Write((byte)c);
            }

            writer.WriteLine(")] TJ");
            writer.WriteLine("ET");
        }
Ejemplo n.º 2
0
        internal override void Write(PdfStreamWriter writer)
        {
            writer.SetState(State);
            writer.WriteLine("q"); // save graphics state
            foreach (var transform in Transforms)
            {
                writer.WriteLine($"  {transform}");
            }

            writer.WriteLine($"  /{Image.ReferenceId} Do"); // paint
            writer.WriteLine("Q");                          // restore graphics state
        }