Settings
PdfFormatProvider allows you to export a RadFlowDocument to PDF. The provider's ExportSettings property controls the export output.
Export Settings
The PdfExportSettings class derives from the Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfExportSettings class related to the RadPdfProcessing library. The export allows you to control the image quality, encryption, compliance level, and other PDF-related properties. For more information, refer to the export settings article for RadPdfProcessing.
Example 1 demonstrates how to export a RadFlowDocument instance to PDF and specify that it must be PDF/A compliant.
To specify export settings to the
PdfFormatProvider, you need to add both theTelerik.Windows.Documents.Fixed.FormatProviders.Pdf.ExportandTelerik.Windows.Documents.Flow.FormatProviders.Pdf.Exportnamespaces. In Example 1 the Fixed alias corresponds to theTelerik.Windows.Documents.Fixed.FormatProviders.Pdf.Exportnamespace.
Example 1: Export PDF/A Compliant Document
Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider pdf_provider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExportSettings settings = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.Export.PdfExportSettings();
settings.ComplianceLevel = Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export.PdfComplianceLevel.PdfA2B;
provider.ExportSettings = settings;
using (Stream output = File.OpenWrite("sample.pdf"))
{
RadFlowDocument flow_document = CreateRadFlowDocument();
provider.Export(flow_document, output, TimeSpan.FromSeconds(10));
}
The 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 listed here. Using these fonts prevents the document from complying with the standard.
Extensibility Manager
The ExtensibilityManager property of the PdfExportSettings class allows you to 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. You can achieve this by registering a custom implementation of the INumberingStyleConverter interface for a 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());