New to Telerik UI for WinForms? Download free 30-day trial

Settings

PdfFormatProvider allows for export of PDF documents and respectively export of RadRichTextEditor to Pdf. Additionally, the export settings provide modification options. The current article outlines the available settings.

Export Settings

PdfFormatProvider exposes ExportSettings, which allow you to control image quality, encryption, compliance level and other PDF format related properties.

  • CommentsExportMode: A property of type PdfCommentsExportMode that gets or sets how the comments should be exported.
    • None: Default mode. The comments will not be exported.
    • NativePdfAnnotations: The comments will be exported as PDF annotation.
  • ContentsCompressionMode: A property of type PdfContentsCompressionMode that gets or sets a value indicating the compression mode used when compressing page contents. This property is an enumeration and it allows the following values:
    • None: No compression.
    • Deflate: The deflate algorithm will be applied to compress the text content of the document.
    • Automatic: Default mode. The best algorithm will be automatically decided upon for you. Currently Deflate is always used.
  • ContentsDeflaterCompressionLevel: A property of type integer between -1 and 9 that gets or sets a value indicating the compression level to be used when deflating the content of the document.
    • -1: Automatic compression, which is currently 6 (Optimal Compression).
    • 0: No Compression. This is the default value of the property.
    • 9: Best Compression.
  • DocumentInfo: A property of type PdfDocumentInfo. You can use this class to retrieve or change the document information. The document information which you can get or change is: Author, Creator, IncludeCreationDate, Keywords, Producer, Subject, Title.
  • DrawPageBodyBackground: A property of type bool that gets or sets a value indicating whether the exporter will draw a rectangle below the page body contents.
  • FloatingUIContainersExportMode: A property of type PdfInlineUIContainersExportMode that get or sets the current mode when exporting floating UI containers.
    • None: When set, the floating UI containers will not be exported.
    • Image: Default mode. All the FloatingUIContainers in the document are added as images in the PDF document.
  • ImagesCompressionMode: A property of type PdfImagesCompressionMode that gets or sets a value indicating the compression mode used when compressing images.
    • None: No compression.
    • Deflate: The deflate algorithm will be applied to compress the images.
    • Jpeg: The Jpeg algorithm will be applied to compress the images.
    • Automatic: Default mode. The best algorithm will be automatically decided upon for you. Currently, Jpeg is used for JPEG images, and Deflate for all others.
  • ImagesDeflaterCompressionLevel: A property of type integer between -1 and 9 that gets or sets a value indicating the compression level to be used when deflating the images in the document. This property is respected when an image is compressed with Deflate mode (see ImagesCompressionMode).
    • -1: Automatic compression, which is currently 6 (Optimal Compression).
    • 0: No Compression. This is the default value of the property.
    • 9: Best Compression.
  • InlineUIContainersExportMode: A property of type PdfInlineUIContainersExportMode that get or sets the mode used when exporting inline UI containers.
    • None: The inline UI containers will not be exported.
    • Image: Default mode. All the InlineUIContainers are added as images to the PDF document.

Setting the ExportSettings of the PdfFormatProvider

PdfExportSettings pdfExportSettings = new PdfExportSettings();
pdfExportSettings.ContentsDeflaterCompressionLevel = 9;
pdfExportSettings.DrawPageBodyBackground = false;
PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
pdfFormatProvider.ExportSettings = pdfExportSettings;

Dim pdfExportSettings As PdfExportSettings = New PdfExportSettings()
pdfExportSettings.ContentsDeflaterCompressionLevel = 9
pdfExportSettings.DrawPageBodyBackground = False
Dim pdfFormatProvider As PdfFormatProvider = New PdfFormatProvider()
pdfFormatProvider.ExportSettings = pdfExportSettings

Pdf import is currently not supported, so there are no import settings.

See Also

In this article