Пример #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");
        }