pdf service not working

I integrated pdf viwer in react and created web service as per the instruction but when I am replacing the url from synfusion to .net web service I am getting below mention error.

A client-side error is found. Please check the custom headers provided in the AjaxRequestSettings property and web action methods in the ServerActionSet

<PdfViewerComponent
id="container"
documentPath={fileUrl}
serviceUrl="https://bregapitest.azurewebsites.net/PdfViewer"
style={{ 'height': '640px' }}>

<Inject services={[Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, BookmarkView,
ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner]} />
</PdfViewerComponent>
</div>



1 Reply

CK Chinnamunia Karthik Chinna Thambi Syncfusion Team February 14, 2024 02:28 PM UTC

Hi Gunjan,


The reported issue occurred when utilizing the provided serviceURL (https://bregapitest.azurewebsites.net/PdfViewer). It appears that the PDF Viewer controller is not mapped correctly. Consequently, we have switched to the following URL (https://bregapitest.azurewebsites.net/api/PdfViewer). Now, the PDF Viewer controller is being called correctly, but we are encountering a CORS error. Kindly test the provided URL and inform us of the result.

 

If you encounter any issues, please provide your controller file and verify that the CORS policy has been configured correctly on your end.


Loader.
Up arrow icon