private void CreateAndPrintText()
        {
            pictureBox1.Refresh();

            var font1 = new Font("Arial Black", 24f, FontStyle.Bold);
            var font2 = new Font("Corbel", 18f, FontStyle.Italic);
            var font3 = new Font("Imprint MT Shadow", 44f, FontStyle.Regular);

            var horisontal = new HorizontalText();
            var vertical   = new VerticalText();

            baseWrites.AddRange(Create(horisontal, "Horizontal", font1, StringAlignment.Near, 6));
            baseWrites.AddRange(Create(horisontal, "Horizontal", font2, StringAlignment.Center, 7));
            baseWrites.AddRange(Create(vertical, "Vertical", font3, StringAlignment.Near, 1));

            textOutput.DrawText(pictureBox1.CreateGraphics(), startPoint, baseWrites);
        }
示例#2
0
// ===========================================================================
        public override void Write(Stream stream)
        {
            // step 1
            using (Document document = new Document(new Rectangle(420, 600))) {
                // step 2
                PdfWriter writer = PdfWriter.GetInstance(document, stream);
                // step 3
                document.Open();
                // step 4
                BaseFont bf = BaseFont.CreateFont(
                    "KozMinPro-Regular", "Identity-V", BaseFont.NOT_EMBEDDED
                    );
                Font         font = new Font(bf, 20);
                VerticalText vt   = new VerticalText(writer.DirectContent);
                vt.SetVerticalLayout(390, 570, 540, 12, 30);
                font = new Font(bf, 20);
                vt.AddText(new Phrase(ConvertCIDs(TEXT1), font));
                vt.Go();
                vt.Alignment = Element.ALIGN_RIGHT;
                vt.AddText(new Phrase(ConvertCIDs(TEXT2), font));
                vt.Go();
            }
        }
示例#3
0
 public Setting()
 {
     Verticaltext = VerticalText.up;
 }