ADD WEB PAGE EXAMPLE

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

This ABCpdf example adds a new page from a web 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)
        {
            // ---- Add a new page from a web page ----
            Doc doc = new Doc();
            doc.Rect.Inset(72, 144);

            int theID = doc.AddImageUrl("http://www.yahoo.com/");

            while (true)
            {
                doc.FrameRect();
                if (!doc.Chainable(theID))
                    break;
                doc.Page = doc.AddPage();
                theID = doc.AddImageToChain(theID);
            }

            for (int i = 1; i <= doc.PageCount; i++)
            {
                doc.PageNumber = i;
                doc.Flatten();
            }

            doc.Save(Server.MapPath("~/Results/Output.pdf"));
            doc.Clear();
        }
    }
}


© 1997-2018 codehacker.com - All Rights Reserved            RapidSSL