RadPdfViewer.DocumentSource Value cannot be null. (Parameter 'page')

1 Answer 236 Views
PDFViewer
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
Kamran asked on 17 Jul 2021, 09:36 AM

I am receiving following error when opening specific pdf document. 

I followed article Value cannot be null. Parameter name - Pages But this article belongs to parameter 'pages' instead 'page'


System.ArgumentNullException: Value cannot be null. (Parameter 'page')
   at Telerik.Windows.Documents.Utilities.Guard.ThrowExceptionIfNull[T](T param, String paramName)
   at Telerik.Windows.Documents.Fixed.Text.TextPosition..ctor(TextPage page, Int32 index)
   at Telerik.Windows.Documents.Fixed.Text.TextPosition..ctor(TextPage page)
   at Telerik.Windows.Documents.Fixed.Text.TextPosition..ctor(TextDocument document)
   at Telerik.Windows.Documents.Fixed.Model.RadFixedDocument.get_CaretPosition()
   at Telerik.Windows.Documents.UI.FixedDocumentPresenterBase.AttachToDocumentEvents(RadFixedDocument document)
   at Telerik.Windows.Documents.UI.FixedDocumentPresenterBase.DoOnDocumentChanged(RadFixedDocument oldDocument, RadFixedDocument newDocument)
   at Telerik.Windows.Controls.FixedDocumentViewerBase.OnDocumentChanged(RadFixedDocument oldValue, RadFixedDocument newValue)
   at Telerik.Windows.Controls.FixedDocumentViewerBase.<>c.<.cctor>b__14_1(DependencyObject s, DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.FixedDocumentViewerBase.set_Document(RadFixedDocument value)
   at Telerik.Windows.Controls.FixedDocumentViewerBase.<>c__DisplayClass90_0.<DocumentSource_Loaded>b__0()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 

Following Pdf document specs might help you

 


3
 0 obj
[/CalRGB<</Gamma[2.2000000476837158 2.2000000476837158 2.2000000476837158]/Matrix[0.4124000072479248 0.2125999927520752 0.019300000742077827 0.35760000348091125 0.71520000696182251 0.11919999867677689 0.18050000071525574 0.072200000286102295 0.9505000114440918]/WhitePoint[0.9505000114440918 1. 1.0889999866485596]>>]
endobj

6
 0 obj
<</ProcSet[/PDF/Text/ImageB/ImageC/ImageI]/XObject<</Img1 5 0 R>>>>
endobj
7
 0 obj
<</Type/Page/Contents 4 0 R/MediaBox[0 0 595 842]/Resources 6 0 R/Parent 1 0 R>>
endobj


1 0 obj
<</Type/Pages/Count 1/Kids[7 0 R]>>
endobj

2 0 obj
<</Type/Catalog/Pages 1 0 R>>
endobj


xref
0 9
0000000000 65535 f 
0000063589 00000 n 
0000063641 00000 n 
0000000016 00000 n 
0000000350 00000 n 
0000000430 00000 n 
0000063406 00000 n 
0000063490 00000 n 
0000063687 00000 n 

trailer
<</Size 8/Root 2 0 R/Info 8 0 R/ID [<cf5c0accdc040b8a5fd298a765972d13><aab7ac8c45a677c67feb6c1e858ec7c9>]>>
startxref
63899
%%EOF

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin
Telerik team
answered on 19 Jul 2021, 08:13 AM

Hello Kamran,

From the provided information it seems you are hitting a known issue related to an invalid according to the PDF Specification document (a split into several lines object definitions). We have this logged in our backlog: PdfViewer: Handle import of documents with invalid/split object definitions. Fortunately, this feature is already developed and it is live with Release R2 2021 SP1.

However, the document you are trying to import could have other issues, so please, try to import it with the assemblies version higher than 2021.2.615 and if this behavior still exists, please, send us the document in order to deeper investigate the case. I must assure you we treat all client files in a strictly confidential manner and for testing purposes only.

Regards,
Martin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
commented on 29 Jul 2021, 09:47 PM

Thanks Martin. Upgrading Telerik dlls to 2021 R2 worked.
Tags
PDFViewer
Asked by
Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Martin
Telerik team
Share this question
or