ADD HTML EXAMPLE

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

This ABCpdf example creates a PDF document that adds a block of HTML styled 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 HTML styled text ----
            string str = 
            "<b>Gallia</b> est omnis divisa in partes tres, " +
            "quarum unam incolunt <b>Belgae</b>, aliam " +
            "<b>Aquitani</b>, tertiam qui ipsorum lingua " +
            "<b>Celtae</b>, nostra <b>Galli</b> appellantur.";
            Doc doc = new Doc();
            doc.FontSize = 72;
            doc.AddHtml(str);
            doc.Save(Server.MapPath("~/Results/Output.pdf"));
            doc.Clear();
        }
    }
}

Add HTML

© 1997-2021    Codehacker - All Rights Reserved