We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Error while creating object of class PdfRenderer

I want to export pdf pages as image with Annotations. So I added following nuget package to my class library.



But I got following error when I tryin to create object of PdfRenderer class 



Please let me know the reason for this error and how can I rectify this error


sample project is also attached to this thread

- package folder is removed from the project to upload the sample here otherwise file size is getting bigger then allowed file size. following are the contents of package folder



Attachment: TestApplication_7e8364f8.zip

1 Reply

VV Visvesvar Venkatesan Syncfusion Team November 14, 2022 02:32 PM UTC

On Analyzing further, we found that you are using EJ2 PDF Viewer ExportAsImage MVC library API in ASP.NET core application. In EJ2 PDF Viewer MVC server library we need to include the System.Runtime.Caching package in sample level. So, we need to install the NuGet package in both projects(i.e TestApplication and TestLib projects).


We have modified the provided sample and shared for your reference below,


https://www.syncfusion.com/downloads/support/directtrac/general/ze/TestApplication_7e8364f81337458249.zip


Instead of using EJ2 PDF Viewer MVC server library ExportAsImage API, you can use EJ2 PDF Viewer ASP.NET core library and refer it in the ASP.NET core application. Kindly find the documentation for it below.


https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/how-to/export-as-image



Loader.
Live Chat Icon For mobile
Up arrow icon