PDF Toolbox SDK for .NET
The PDF Toolbox SDK for .NET lets you create PDF files using .NET.
For more information on the document model, graphics model, and thread safety, see About the PDF Toolbox SDK.
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:
IllegalArgumentmaps toSystem.ArgumentExceptionIllegalStatemaps toSystem.InvalidOperationExceptionUnsupportedOperationmaps toSystem.NotSupportedException
Additionally, the following infrastructure error is mapped:
IOmaps toSystem.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>.