im trying to figure out how to implement the pdf viewer using an asmx web service instead of an API controller but i cannot seem to get it to work. is it even possible to use something other than an API controller with the pdf viewer control?
we use asmx for web services. I've also tried using an api controller in a test solution but i cannot get that to work either. I followed the documentation "how to" page but it doesn't work. also the example that you can download at the bottom of this page (https://ej2.syncfusion.com/javascript/documentation/pdfviewer/how-to/create-pdfviewer-service/) doesn't work. it doesn't have any csproj files. Is there an example project that has the projects files included?
Update: I'm trying to get the pdf viewer control to work with an api controller. I was having issues getting it to work but it turns out I was using the wrong url to the api. But now I'm getting an error in the page that says " Web-service is not listening. PDF Viewer depends on web-service for all it's features. Please start the web service to continue." also, i need to be able to load a different pdf from a different location. not sure how to do that. i could share the example solution i created to test the control if that would make it easier to figure out how to get it working.
thanks.
|
viewer.load('PDF_Succinctly.pdf', null);
Note: We need to place the PDF documents in the server location |
|
Viewer.load(“data:application/pdf;base64,…..”,null);
|
I don't think those solutions will work as I am using Javascript not Typescript. I think I may have finally gotten it working by changing the routeTemplate in the webApiConfig file. also, with the custom toolbar is there a prefix icon (ex: e-pv-open-document for the open button) for a save button? I want to be able to load the pdf from another location when loading the viewer and save it from the viewer.
|
Query |
Details | |||
|
I don't think those solutions will work as I am using Javascript not Typescript. I think I may have finally gotten it working by changing the routeTemplate in the webApiConfig file. |
Thank you for the update. We have shared the javascript sample for your reference. Please refer to the below link.
| |||
|
also, with the custom toolbar is there a prefix icon (ex: e-pv-open-document for the open button) for a save button? I want to be able to load the pdf from another location when loading the viewer and save it from the viewer.
|
You can add the icon to the custom toolbar using below code snippet.
Code Snippet:
You can load the document from various locations using the open icon in the toolbar and you can download the document using a download icon in the toolbar. Please refer to the below sample.
We have shared the code Snippet and sample to save the PDF document in the server location. Please refer to the below code snippet and sample.
Code Snippet for client-side:
Code Snippet for server-side:
Documentation:
|
ok. I was able to get things working however there is still a JavaScript error I am getting in the ej2-pdfviewer.min.js file and I don't know why. its not causing anything to break but its still odd that there's an error.