DGDeepak Gunasekaran Syncfusion Team January 17, 2020 10:48 AM
Based on the exception details, we could see that the Accessibiity.dll is missing to be referred in the application which caused the issue. Kindly ensure whether the Accessibility.dll available in the location “C:\Windows\Microsoft.NET\Framework64\v4.0.30319” and it is referred properly in the project. You may refer the framework dependencies directly or install via nuget packages to avoid the kind of errors in the application.
We have created a workable sample to perform silent printing with your code snippet in the ASP.Net core web API using Syncfusion.PdfViewer.Windows and it can be downloaded from the below location.
Please try the sample and let us know whether it meets your requirement.
ALAliJanuary 18, 2020 08:48 AM
Thank you for the solution. Everything is working perfectly now.
However, I want to set the printer page size and orientation, since the page size I set when creating the pdf is different from the print out.
USUthandaraja Selva Sundara Kani Syncfusion Team January 20, 2020 07:53 AM
Currently we are checking on this and we will update you shortly.
USUthandaraja Selva Sundara Kani Syncfusion Team January 20, 2020 09:20 AM
Thanks for your patience.
We can achieve the requirement of customize the page orientation and size using the PrintDocument.DefaultPageSettings API. Please find the code snippet below to customize the page orientation of printing document,
Please let us know if you need further assistance.
LOLorneDecember 23, 2020 05:31 AM
I have downloaded and run the example application from the link provided above. It works as advertised. However when I implement the code in my own .NET Core application, and run it from my hosted site rather than locally, it no longer works. I get the following error. Again my own application runs fine locally, but not hosted. Is there any recommendations for this?
DGDeepak Gunasekaran Syncfusion Team December 24, 2020 08:41 AM
Based on the error details, we suspect that this error occurred due to the environment details isn’t set which might have disabled most debugging features. Can you please follow the steps provided in the following page to set the environment variable and let us know whether it resolves the issue?