Skip to main content
Version: 4.1

PdfViewer

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a PdfViewer control that can display a pdf document in the browser either using the native pdf viewer, the pdf.js viewer, Google docs, or a custom viewer.

public class PdfViewer : Control, IWisejHandler

Constructors

Instance member PdfViewer()

Initializes a new instance of the PdfViewer class.

Properties

Instance member BorderStyle

BorderStyle: Indicates the border style for the control. (Default: None)

Instance member FileName

String: Returns or sets the file name used in the "Content-Disposition" header when returning the PDF content to the PDF viewer. The name may be used when downloading the file, depending on the type of PDF viewer loaded in the browser. Since 3.5.5

When FileName is not assigned, the PdfViewer will use the file name extracted from the PdfSource property. When using the PdfStream instead, the file name is left blank unless specified using the FileName property.

Instance member PdfSource

String: Returns or sets the pdf file name to display in the PdfViewer control. (Default: "")

Instance member PdfStream

Stream: Returns or sets the pdf stream to display in the PdfViewer control.

Instance member ViewerType

PdfViewerType: Returns or sets the PdfViewerType to use on the client. (Default: Auto)

Instance member ViewerURL

String: Returns or sets the URL of the PDF viewer to use on the client. It's required when ViewerType is Custom, optional for Mozilla or Google, and not used for Auto. (Default: "")

You can use the following placeholders in the ViewerURL string:

  • [source]: Replaced with the postback URL to the PdfViewer control that serves the PDF content.
  • [filename]: Replaced with the value of FileName and the ".pdf" extension in case the file name doesn't specify an extension.

Methods

Protected member OnPdfSourceChanged(e)

Fires the PdfSourceChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnWebEvent(e)

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Events

Instance member PdfSourceChanged

EventHandler Fired when the PdfSource property is changed.

Implements

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejHandlerRepresents a Wisej component that is capable of handling postback requests from the client.
IWisejSerializableAllows an object to serialize itself.