Getting Started
This article shows how to create a PDF document with RadPdfProcessing.
If you still don't have Telerik Document Processing installed, check the First Steps topic to learn how you can obtain the packages through the different suites.
Required References
You can find the required references in the PdfProcessing NuGet packages section.
Creating a Document
RadFixedDocument is the root element in the library. It consists of RadFixedPage objects and instructions for annotations and destinations in the document. Example 1 shows how to create a document and add a page to it.
Example 1: Create a RadFixedDocument
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
The page can then be edited through a FixedContentEditor instance. Example 2 creates an editor and adds a TextFragment to the page object created in Example 1.
Example 2: Add text
FixedContentEditor editor = new FixedContentEditor(page);
editor.DrawText("Hello RadPdfProcessing!");
Exporting to PDF
Exporting to PDF format can be achieved with the PdfFormatProvider class. Example 3 shows how to export the RadFixedDocument created in Examples 1 and 2 to a file.
Example 3: Export to PDF
PdfFormatProvider provider = new PdfFormatProvider();
using (Stream output = File.OpenWrite("Hello.pdf"))
{
provider.Export(document, output, TimeSpan.FromSeconds(10));
}
For more complete examples, see the developer-focused examples for the library.