Last Updated: 28 Jul 2022 07:58 by ADMIN
Release R3 (LIB 2022.2.711)
Created on: 01 Jul 2022 11:31
Category: PdfViewer
Type: Bug Report
PdfViewer: Loading PDF documents with large images will throw ArgumentException

With the R1 2021 version of our controls RadPdfViewer is using the RadPdfProcessing library model. In this scenario, the PDF document contains images with sizes 87380, 87654. Internally the control is using RenderTargetBitmap to draw the image. So when we pass these values as Width and Height to the constructor of this object an exception occurs. This is a limitation of the RenderTargetBitmap class. It can be reproduced outside of the RadPdfViewer.

RenderTargetBitmap bmp = new RenderTargetBitmap(87380, 87654,96,96,PixelFormats.Pbgra32);

As a workaround, we can use the old rendering engine of the control by setting the RadPdfViewer.UsePdfProcessingModel property to false

1 comment
Posted on: 05 Jul 2022 06:21
The workaround is not really a useful option as we have seen examples of other PDF's that causes crashes when using the old processing model.