How to use the EJ1 PDF viewer control in ASP.NET core
At present, EJ1 PDF viewer control is not supported in the ASP.NET Core platform. However, you can use the PDF viewer control of EJ1 platform in the ASP.NET Core platform. The server (web API controller) for loading and processing the PDF document must be defined as a separate Web application. The URL of this application must be referred to the serviceUrl property of the PDF viewer control in the ASP.NET core application.
HMTL
<div class="control"> <div id="container" style="width:100%;height:780px;"></div> </div> <script type="text/javascript"> $(function () { //If the hosted custom service URL is http://localhost:57971/, then serviceURL should be as follows $("#container").ejPdfViewer({ serviceUrl: 'http://localhost:57971/api/PdfViewer' }); }); </script>
Refer to the following samples for EJ1 PDF viewer control in the ASP.NET Core application.
Web API controller: http://www.syncfusion.com/downloads/support/directtrac/general/ze/WebAPI_service830758858
ASP.NET Core:httpwww.syncfusion.com/downloads/support/directtrac/general/ze/PdfViewer_ASP.NET_Core1949388477
You can also refer the online service in the serviceUrl property of the PDF viewer control. Refer to the following code snippet.
JavaScript
script type="text/javascript"> $(function () { $("#container").ejPdfViewer({ serviceUrl:'http://js.syncfusion.com/ejServices/api/PdfViewer' }); }); </script>