ADD BITMAP 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 bitmap 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 Bitmap to the current page ----
            Doc doc = new Doc();
            string thePath = Server.MapPath("~/images/foxdog.png");
            Bitmap bm = new Bitmap(thePath);
            doc.Rect.Inset(20, 20);
            doc.Color.String = "0 0 200";
            doc.FillRect();
            doc.AddImageBitmap(bm, true);
            bm.Dispose();
            doc.Save(Server.MapPath("~/Results/Output.pdf"));
            doc.Clear();
        }
    }
}


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