Idris Stack
Idris Stack

Reputation: 566

Wrapping contents of cshtml in pdf viewer of Syncfusion

How can I connect cshtml content to ejs-pdfviewer, I want to use it as andvantage to be able to print I want I have set into the PdfViewer with syncfusion, is it possible?'

Is there any attribute I have to add to enable this functionality, or is there a special way to achieve this in syncfusion?

Below is the cshtml code :

  <ejs-pdfviewer id="container" style="height: 600px"
                   serviceUrl="/api/PdfViewer"
                   documentPath="@Path"

                   enablePrint="true">

    </ejs-pdfviewer>

Upvotes: 0

Views: 325

Answers (1)

user3089664
user3089664

Reputation: 56

Currently, PDF Viewer do not have support to display the cshtml page directly. However, we can convert the cshml to PDF and then we can load that PDF document in PDF Viewer. We have created the sample for the same and shared in the following location,

https://www.syncfusion.com/downloads/support/directtrac/general/ze/ViewToPDF_Core1313262793

In the above sample click on ‘ConvertToPDF’ to load the cshtml page in PDF Viewer.

PDF Viewer: UG link: https://ej2.syncfusion.com/aspnetcore/documentation/pdfviewer/getting-started/

Reference links for Html to PDF Conversion: UG: https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit KB: https://www.syncfusion.com/kb/9779/how-to-convert-html-to-pdf-in-azure-using-net-core MVC view to PDF (.NET Framework): https://www.syncfusion.com/kb/6024/how-to-convert-mvc-view-to-pdf-using-c-and-vb-net

Note: For converting HTTPS sites, the HTML converter requires OPENSSL libraries to be installed in the machine where the conversion takes place. Please find the below link for reference https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit#openssl

Regards,

Ramya T

Upvotes: 1

Related Questions