BCL easyPDF SDK
easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

PDFDocument Object Description

This object represents a PDF document. This is the entry point for accessing all of the easyPDF PDF Document SDK feature. This object lets you retrieve and modify information from/to PDF documents. This object currently supports processing PDF form fields.

COM Object Identifiers

ProgID easyPDF.PDFDocument.8
CLSID A8A757D1-C284-48B6-9DC1-1B7DB2CD65CD
TypeLib UUID BCF5F49F-5321-40BE-B02A-11A58AE10D46

Object Namespaces

COM, C++ EasyPDFDocument
.NET COM BCL.easyPDF8.Interop.EasyPDFDocument
Native .NET BCL.easyPDF.PDFDocument
Java COM com.bcl.easypdf.EasyPDFDocument.*
Native Java com.bcl.easypdf.document.*

Example Usage (VB)


Set oDocument = CreateObject("easyPDF.PDFDocument.8")
 
oDocument.Open "C:\test\input.pdf"
Set oFormFields = oDocument.FormFields
 
Set oTextField = oFormFields("My Text Field")
oTextField.Value = "Hello"
 
oDocument.SaveAs "C:\test\output.pdf"
oDocument.Close False

Visual C++

In modern versions of Visual C++, easyPDF Document should be imported the following way:

#import "progid:easyPDF.PDFDocument.8"

If you need to support multiple versions of Visual Studio, we recommend this solution:

#if _MSC_VER <= 1200 // VC6 or older
#import "c:\Program Files\Common Files\BCL Technologies\easyPDF 8\bepdoc.dll"
#else
#import "progid:easyPDF.PDFDocument.8"
#endif

Native .NET API

There is now a 100% native .NET API for easyPDF Document, which is strongly recommended over the traditional COM objects.

All native .NET declarations and sample code have a light yellow background color, like this:

using(PDFDocument document = new PDFDocument())
{
   document.FormFields["My Text Field"].Value = "Hello";
   document.SaveAs(@"C:\test\output.pdf");
   document.Close(false);
}

Native Java API

There is now a 100% native Java API for easyPDF Document, which is strongly recommended over the traditional JACOB Java COM bridge.

All native Java declarations and sample code have a light red background color, like this:

PDFDocument document = new PDFDocument();
try
{
   document.getFormFields().getItem("My Text Field").setValue("Hello");
   document.SaveAs("C:\\test\\output.pdf");
   document.Close(false);
}
catch(PDFDocumentException e)
{
   System.out.println(e);
}
finally
{
   document.dispose();
}