ADD PAGE EXAMPLE

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

This ABCpdf example adds a page 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 page to the current document ----
            Doc doc = new Doc();
            doc.FontSize = 96; // big text
            doc.HPos = 0.5; // centered
            doc.VPos = 0.5; // ...
            for (int i = 1; i <= 3; i++)
            {
                doc.Page = doc.AddPage();
            string txt;
                txt = "Page " + i.ToString() + ", ID=";
                txt = txt + doc.Page.ToString();
                doc.AddText(txt);
            }
            doc.Save(Server.MapPath("~/Results/Output.pdf"));
            doc.Clear();
        }
    }
}

Add Page

© 1997-2021    Codehacker - All Rights Reserved