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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PDF Viewer is not working

Thread ID:

Created:

Updated:

Platform:

Replies:

142077 Jan 17,2019 01:19 PM UTC Jan 18,2019 02:27 PM UTC ASP.NET MVC - EJ 2 1
loading
Tags: PDF Viewer
Maico Schmitz
Asked On January 17, 2019 01:19 PM UTC

Hi,

PDF Viewer is not correctly working. It result on a modal with error message. What's wrong?





Karthik Krishnaraj [Syncfusion]
Replied On January 18, 2019 02:27 PM UTC

Hi Maico, 
 
Greetings from Syncfusion, 
 
We have analyzed the provided query “PDF Viewer is not correctly working” and we suspect that the issue is due to incorrect mapping of Serviceurl in your project. We need to add the controller name at the end of the localhost for accessing the data from the client to the server. Please find the below example. 
 
 
WebAPI Controller: 
 
@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(“http://localhost /api/PdfViewer/”)  
 
In “api/pdfViewer” where pdfviewer refers to the name of the webAPIController (api/webAPIControllername) 
 
(or) 
 
MVC Controller: 
@Html.EJS().PdfViewer("pdfviewer").ServiceUrl(“http://localhost /PdfViewer/”)  
 
In “/pdfViewer” where pdfviewer refers to the name of the MVCController (MVCcontrollername) 
 
 
//where localhost=http://192.168.0162:81 according to the provided snippet 
 
Note: Please use the webAPIControllername/ MVCcontrollername name as per you have provided in your hosted webservice. 
 
 
 
 
We have created the simple MVC sample, please download the sample from the below link. 
 
 
 
In the provided sample we have  both MVC controller and webAPI PDF Viewer controller for accessing the data form the client to the server, so you can refer any one of them in the serviceurl ,Kindly refer the below code snippet. 
 
WebAPI Controller: 
 
        @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/api/PdfViewer/")).DocumentPath("PDF_Succinctly.pdf").Render() 
 
 
 
 
MVC Controller: 
 
        @Html.EJS().PdfViewer("pdfviewer").ServiceUrl(VirtualPathUtility.ToAbsolute("~/PdfViewer/")).DocumentPath("PDF_Succinctly.pdf").Render() 
 
 
 
Regards, 
Karthik. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;