Application crashes with exception while creating for a particular PDF document

Ashok Kumar 1 Reputation point

Description : We have been using Windows run time API to access the PDF pages and we will convert the pdf pages into Image, to view the page content in our custom control. However we are facing exception while converting input stream to PdfDocument

Code snippet to replicate the issue:
// Stream is input stream of PDF document
stream.Position = 0;
randomStream = await ConvertToRandomAccessStream(stream as MemoryStream);
IAsyncOperation<global::Windows.Data.Pdf.PdfDocument> result = global::Windows.Data.Pdf.PdfDocument.LoadFromStreamAsync(randomStream, passWord);
// Throws one or more exception at this line
PdfDocument = result.GetResults();

Attached PDF document.

PDF document :

Kindly provide solution ASAP.

Ashok Kumar Viswanathan

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,316 questions
Universal Windows Platform (UWP)
{count} votes