From the PDF specification:
Prev: (Present only if the file has more than one cross-reference section; must not be an indirect reference) The byte offset from the beginning of the file to the beginning of the previous cross-reference section.
When importing such a document an exception is thrown: System.ArgumentNullException: 'Value cannot be null.
Observed when loading a document:
From the PDF Specification: "An ink annotation represents a freehand “scribble” composed of one or more disjoint paths. When opened, it displays a pop-up window containing the text of the associated note."
Sometimes the Ink annotations are imported as UnsupportedAnnotation and not displayed as expected. In such cases, the annotations could be removed from the RadFixedPage content in the following manner:
foreach (RadFixedPage page in document.Pages)
{
List<Annotation> inkAnnotations = page.Annotations.Where(a => a.Type == AnnotationType.Ink).ToList();
foreach (Annotation inkAnnotation in inkAnnotations)
{
page.Annotations.Remove(inkAnnotation);
}
}
A memory leak occurs in the RadTreeView control used for the table of contents in the RadPdfViewerNavigationPane, when changing the DocumentSource of RadPdfViewer at runtime.
To work this around, you can get the RadTreeView used by RadPdfViewerNavigationPane and manually clear its internal item storage before assigning the new DocumentSource.
private void ReloadDocument()
{
var navigationPane = this.pdfViewerNavigationPane;
var navigationPaneTreeView = navigationPane.FindChildByType<RadTreeView>();
if (navigationPaneTreeView != null)
{
object itemStorage = typeof(RadTreeView)
.GetProperty("ItemStorage", BindingFlags.Instance | BindingFlags.NonPublic)
.GetValue(navigationPaneTreeView);
MethodInfo itemStorageClearMethod = itemStorage.GetType().GetMethod("Clear", BindingFlags.Instance | BindingFlags.NonPublic);
itemStorageClearMethod.Invoke(itemStorage, null);
}
this.DocumentSource = theNewDocumentSource;
}