Skip to main content
Version: 4.4

PDF Toolbox SDK for .NET

The PDF Toolbox SDK for .NET lets you create PDF files using .NET.

note

For more information on the document model, graphics model, and thread safety, see About the PDF Toolbox SDK.

tip

For the full API reference for the PDF Toolbox SDK, see the .NET API reference.

IDisposable objects

Objects that must be closed explicitly (such as those based on Document, ContentGenerator, and TextGenerator classes) implement the IDisposable interface. Instead of calling Dispose() directly, it is recommended that you use the “using” statement:

using (Document document = ...)
{
...
}
// document.Dispose() is called implicitly here

See also Garbage collection and closing objects.

Error handling

Errors are reported using exceptions. The following logic errors are mapped to the corresponding native exception classes:

  • IllegalArgument maps to System.ArgumentException
  • IllegalState maps to System.InvalidOperationException
  • UnsupportedOperation maps to System.NotSupportedException

Additionally, the following infrastructure error is mapped:

  • IO maps to System.IO.IOException

The remaining errors are modeled using exception classes that inherit from the class PdfToolboxException.

Streams

The native stream interface System.IO.Stream is used.

Lists

Lists implement the native list interface System.Collections.Generic.IList<T>.

Enumerables

Enumerables implement the native interface System.Collection.Generic.IEnumerable<T>.

Maps

Maps implement the native dictionary interface System.Collections.Generic.IDictionary<K, V>.