Available for: UI for ASP.NET MVC | UI for ASP.NET AJAX | UI for Blazor | UI for WPF | UI for WinForms | UI for Xamarin | UI for WinUI | UI for ASP.NET Core | UI for .NET MAUI

New to Telerik Document Processing? Download free 30-day trial

Settings

PdfFormatProvider allows to export of RadFlowDocument to PDF. Using the provider’s ExportSettings property you can control how exactly the result file should be exported.

Export Settings

The PdfExportSettings class derives from the Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExportSettings class related to the RadPdfProcessing library. Thus, the export allows you to control the image quality, encryption, compliance level and other PDF format related properties. More information on the settings are available in the export settings article for RadPdfProcessing.

Example 1 demonstrates how to export a RadFlowDocument instance to PDF and specify that it needs to be PDF/A compliant.

In order to specify export settings to the PdfFormatProvider you need to add both the Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export and Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export namespaces. In Example 1 the Fixed alias corresponds to the Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export namespace.

Example 1: Export PDF/A compliant document

PdfFormatProvider provider = new PdfFormatProvider(); 
PdfExportSettings settings = new PdfExportSettings(); 
settings.ComplianceLevel = Fixed.PdfComplianceLevel.PdfA2B; 
 
provider.ExportSettings = settings; 
 
using (Stream output = File.OpenWrite("sample.pdf")) 
{ 
    RadFlowDocument document = CreateRadFlowDocument(); 
    provider.Export(document, output); 
} 

PDF/A standard requires documents to contain all fonts used in them within the document. RadPdfProcessing does not support embedding of the standard 14 fonts used in PDF documents that are listed here, so using them will prevent the document from complying with the standard.

Extensibility Manager

The ExtensibilityManager property of the PdfExportSettings class allows to easily extend the currently supported functionality of the RadFlowDocument export to PDF.

ExtensibilityManager provides an option to control how lists with different NumberingStyle options are exported to PDF. This can be achieved by registering custom implementation of the INumberingStyleConverter interface for some concrete NumberingStyle enumeration value.

Example 2 shows how to register a custom ChineseCountingConverter class instance that converts a number with NumberingStyle.ChineseCounting.

Example 2: Register numbering style converter

provider.ExportSettings.ExtensibilityManager.RegisterNumberingStyleConverter(NumberingStyle.ChineseCounting, new ChineseCountingConverter()); 

See Also

In this article