Using PdfFormatProvider
Telerik Document Processing includes the PdfFormatProvider class in RadWordsProcessing for exporting RadFlowDocument instances to PDF.
To use PdfFormatProvider, reference the following packages:
Telerik.Documents.CoreTelerik.Documents.FlowTelerik.Documents.Flow.FormatProviders.PdfTelerik.Documents.Fixed
If your project uses the Windows-only package family, use the corresponding Telerik.Windows.Documents.* package names instead.
Starting with Q2 2025, the ZipLibrary is no longer used as an internal dependency in the rest of the Document Processing Libraries—PdfProcessing, WordsProcessing, SpreadProcessing, SpreadStreamProcessing. It is replaced by System.IO.Compression. The Telerik Zip Library continues to ship as a standalone library so you can still use it separately.
Export
To export a document to PDF, use the Export() method of PdfFormatProvider. The provider is in the Telerik.Documents.Flow.FormatProviders.Pdf namespace and exposes a PdfExportSettings instance through its ExportSettings property.
In .NET Standard,
PdfFormatProviderneeds access to font data before it can embed fonts in the PDF file. Provide an implementation of theFontsProviderBaseabstract class and assign it to theFontsProviderproperty ofFixedExtensibilityManager. Also set theJpegImageConverterproperty ofFixedExtensibilityManagerwhen you export images other than JPEG and JPEG 2000, or whenImageQualityis notHigh. For more information, see how cross-platform support works in RadPdfProcessing.
The code snippet in Example 1 shows how to create a PdfFormatProvider instance and use it to export a RadFlowDocument to a file.
Example 1: Create a PdfFormatProvider and export a RadFlowDocument to a sample.pdf file stream
Telerik.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider provider = new Telerik.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
using (Stream output = File.OpenWrite("sample.pdf"))
{
RadFlowDocument document = CreateRadFlowDocument();
provider.Export(document, output, TimeSpan.FromSeconds(10));
}
The method produces a PDF document that you can open in any PDF viewer.
Example 2 shows how to export a RadFlowDocument directly to a RadFixedDocument through the ExportToFixedDocument() method.
Example 2: Export a RadFlowDocument directly to a RadFixedDocument instance
RadFlowDocument document = CreateRadFlowDocument();
Telerik.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider provider = new Telerik.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
RadFixedDocument fixedDocument = provider.ExportToFixedDocument(document, TimeSpan.FromSeconds(10));
RadFixedDocumentis the main document model inRadPdfProcessing. For more information, see the RadPdfProcessing overview.