RadFixedDocument

RadFixedDocument is the document that is used in RadPdfViewer.

Creation

An instance of RadFixedDocument can be created using PdfFormatProvider and assigned to RadPdfViewer in the following way:

    Stream stream = Application.GetResourceStream(new Uri("PdfViewerDemo;component/SampleData/test.pdf", UriKind.Relative)).Stream;
    RadFixedDocument document = new PdfFormatProvider(stream, FormatProviderSettings.ReadOnDemand).Import();
    this.pdfViewer.Document = document;

The PdfFormatProvider of RadPdfViewer must not be confused with that of RadRichTextBox.Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider is the provider that RadPdfViewer uses to import files. It is located in the Telerik.Windows.Documents.Fixed assembly.For reference, the Telerik.Windows.Documents.FormatProviders.Pdf.PdfFormatProvider of RadRichTextBox is included in the Telerik.Windows.Documents.FormatProviders.Pdf assembly, in a namespace with the same name. The latter can be used only to export RadDocument to PDF.

As you can see, the PdfFormatProvider accepts two parameters – stream with the contents of the PDF file and format provider settings specifying the loading mode.

Members

The members that RadFixedDocument exposes are:

  • Pages - a collection of RadFixedPage items created for the current document in the viewer;

  • Selection - information about the current selection in the document. Read more

  • Annotations - a collection of all annotations (such as links) in the current document. Read more

  • Destinations - a collection of all destinations (roughly said “bookmarks”) in the document that have links to them. Read more

  • CaretPosition – the current position of the caret. Read more

In this article
Not finding the help you need? Improve this article