ADD BLOCK OF TEXT EXAMPLE

The following .NET application has been developed using ABCpdf, ASP.NET, and the C# language.

This ABCpdf example adds a block of text to the current page.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using System.Text;
using System.Net;
using System.IO;
using WebSupergoo.ABCpdf8;

namespace ABCpdfExamples
{
    public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // ---- Adds a block of text to the current page ----
            Doc doc = new Doc();
            doc.Page = doc.AddPage();
            doc.FontSize = 48;
            int theF1 = doc.AddFont("Times-Roman");
            int theF2 = doc.AddFont("Times-Bold");
            doc.Font = theF1;
            doc.AddText("Gallia est omnis ");
            doc.Font = theF2;
            doc.AddText("tertiam Galli appellantur ");
            doc.Font = theF1;
            doc.AddText("divisa in partes tres, ");
            doc.Font = theF2;
            doc.AddText("quarum unam incolunt ");
            doc.Font = theF1;
            doc.AddText("Belgae, aliam Aquitani. ");
            doc.Font = theF2;
            doc.AddText("tertiam Galli appellantur");
            doc.Save(Server.MapPath("~/Results/Output.pdf"));
            doc.Clear();
        }
    }
}

Add Block Text

© 1997-2021    Codehacker - All Rights Reserved