Approved
Last Updated: 25 Jul 2019 07:16 by ADMIN
Georgi
Created on: 25 Jul 2019 07:15
Category: PDFViewer
Type: Bug Report
0
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