Completed
Last Updated: 05 Jul 2023 08:11 by ADMIN
Release R2 2023 SP1
Georgi
Created on: 25 Jul 2019 07:15
Category: PDFViewer
Type: Bug Report
3
PdfViewer: Unhandled ArgumentNullException is thrown when importing document with no pages

When importing a document with empty pages collection an ArgumentNullException: 'Value cannot be null.
Parameter name: page', is thrown, which leads to application crash.

Workaround: Import the document using the PdfProcessing library and add an empty page:

PdfFormatProvider pdfProcessingFormatProvider = new PdfFormatProvider();
RadFixedDocument document = pdfProcessingFormatProvider.Import(stream);
  
if (document.Pages.Count == 0)
{
    document.Pages.AddPage();
}

 

0 comments