Skip to main content

PDFViewer

Namespace: Wisej.Web.Ext.Syncfusion2

Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)

The PDF Viewer component enables you to view and print the PDF files.

public class PDFViewer : ej2Base

The control wraps the EJ2 PdfViewer component, which renders the documents using a PDF Viewer web service. When the serviceUrl option is not set, the control assigns a default service URL generated for the widget: set serviceUrl to the URL of the PDF Viewer web service of the application.

Constructors​

Instance member PDFViewer()​

Constructs a new instance of the PDFViewer class.

Example:

The following example creates a PDF viewer and loads a document through the Options object.

var pdfViewer = new PDFViewer();
pdfViewer.Options.serviceUrl = "/api/PdfViewer";
pdfViewer.Options.documentPath = "Invoice.pdf";
pdfViewer.Dock = DockStyle.Fill;
this.Controls.Add(pdfViewer);

Instance member PDFViewer(options)​

Constructs a new instance of the PDFViewer class.

NameTypeDescription
optionsObjectInitial set of options.

Example:

The following example creates a PDF viewer that does not allow the user to print or download the document, and then loads a different document.

var pdfViewer = new PDFViewer(new
{
serviceUrl = "/api/PdfViewer",
documentPath = "Contract.pdf",
enablePrint = false,
enableDownload = false
});
pdfViewer.Dock = DockStyle.Fill;
this.Controls.Add(pdfViewer);

// load another document, without a password.
pdfViewer.Instance.load("Annex.pdf", null);

Implements​