ADD NATIVE PDF OBJECT EXAMPLE

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

This ABCpdf example adds a native PDF object to the document.

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 native PDF object to the document ----
            Doc doc = new Doc();
            doc.Read(Server.MapPath("~/images/fox_dog_raw_image.pdf"));
            if (doc.GetInfo(-1, "/Info") == "")
                doc.SetInfo(-1, "/Info:Ref", 
                doc.AddObject("<< >>").ToString());
            doc.SetInfo(-1, "/Info*/Author:Text", "Arthur Dent");
            doc.SetInfo(-1, "/Info*/Title:Text", "Musings on Life");
            doc.SetInfo(-1, "/Info*/Subject:Text", "Philosophy");
            doc.SetInfo(doc.Root, "/Metadata:Del", "");
            doc.Save(Server.MapPath("~/Results/Output.pdf"));
            doc.Clear();
        }
    }
}


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