Class PdfViewerHelper
Inheritance
Inherited Members
Namespace: Syncfusion.EJ.PdfViewer
Assembly: Syncfusion.EJ.PdfViewer.dll
Syntax
public class PdfViewerHelper
Constructors
PdfViewerHelper()
Declaration
public PdfViewerHelper()
Fields
CachePath
Declaration
public static string CachePath
Field Value
Type | Description |
---|---|
System.String |
FilePath
Declaration
public static string FilePath
Field Value
Type | Description |
---|---|
System.String |
Properties
DocumentStream
Gets the stream of the PDF document from loaded document.
Declaration
public MemoryStream DocumentStream { get; }
Property Value
Type | Description |
---|---|
System.IO.MemoryStream |
PageCount
Gets the page count.
Declaration
public int PageCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ReferencePath
Specifes the pdfium assembly path in PDF Viewer control.
Declaration
public static string ReferencePath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RenderingEngine
Specifes the rendering mode in PDF Viewer control.
Declaration
public static PdfViewerHelper.PdfRenderingEngine RenderingEngine { get; set; }
Property Value
Type | Description |
---|---|
PdfViewerHelper.PdfRenderingEngine |
Methods
Dispose()
Dispose the unused memory from server side.
Declaration
public void Dispose()
ExportAsImage(Int32)
Exports the specified page as Image
Declaration
public Bitmap ExportAsImage(int pageindex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageindex |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | Returns the specified page as Image |
ExportAsImage(Int32, SizeF, Boolean)
Exports the specified page as Image
Declaration
public Bitmap ExportAsImage(int pageIndex, SizeF customSize, bool keepAspectRatio)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The page index to be converted into image |
System.Drawing.SizeF | customSize | The custom size of the converted image |
System.Boolean | keepAspectRatio | Whether need to keep the aspect ratio of the page |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | Returns the image with custom size |
ExportAsImage(Int32, SizeF, Single, Single, Boolean)
Exports the specified page as Image
Declaration
public Bitmap ExportAsImage(int pageIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The page index to be converted into image |
System.Drawing.SizeF | customSize | The custom size of the converted image |
System.Single | dpiX | The horizontal DPI of the resultant image. |
System.Single | dpiY | The vertical DPI of the resultant image. |
System.Boolean | keepAspectRatio | Whether need to keep the aspect ratio of the page |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | Returns the specified page as image with custom size and resolution |
ExportAsImage(Int32, Int32)
Exports the specified pages as Images
Declaration
public Bitmap[] ExportAsImage(int startIndex, int endIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startIndex | The starting page index |
System.Int32 | endIndex | The ending page index |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap[] | Returns the specified pages as Images |
ExportAsImage(Int32, Int32, SizeF, Boolean)
Exports the specified pages as Images
Declaration
public Bitmap[] ExportAsImage(int startIndex, int endIndex, SizeF customSize, bool keepAspectRatio)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startIndex | The starting page index |
System.Int32 | endIndex | The ending page index |
System.Drawing.SizeF | customSize | The custom size of the converted image |
System.Boolean | keepAspectRatio | Whether need to maintain the pdf page size |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap[] | Returns the specified pages as images with custom size |
ExportAsImage(Int32, Int32, SizeF, Single, Single, Boolean)
Exports the specified pages as Images
Declaration
public Bitmap[] ExportAsImage(int startIndex, int endIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startIndex | The starting page index |
System.Int32 | endIndex | The ending page index |
System.Drawing.SizeF | customSize | The custom size of the converted image |
System.Single | dpiX | The horizontal DPI of the resultant image. |
System.Single | dpiY | The vertical DPI of the resultant image. |
System.Boolean | keepAspectRatio | Whether need to maintain the pdf page size |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap[] | Returns the specified pages as images with custom size and resolution |
ExportAsImage(Int32, Int32, Single, Single)
Exports the specified pages as Images with respect to dpi specified.
Declaration
public Bitmap[] ExportAsImage(int startIndex, int endIndex, float dpiX, float dpiY)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startIndex | The starting page index |
System.Int32 | endIndex | The ending page index |
System.Single | dpiX | The horizontal DPI of the resultant image. |
System.Single | dpiY | The vertical DPI of the resultant image. |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap[] | Returns the specified pages as Images with custom resolution |
ExportAsImage(Int32, Single, Single)
Exports the specified page as Image with respect to dpi specified.
Declaration
public Bitmap ExportAsImage(int pageIndex, float dpiX, float dpiY)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | The page index to be converted into image |
System.Single | dpiX | The horizontal DPI of the resultant image. |
System.Single | dpiY | The vertical DPI of the resultant image. |
Returns
Type | Description |
---|---|
System.Drawing.Bitmap | Returns the specified page as Image with custom resolution |
ExtractText(Int32, out List<TextData>)
Extracts text along with its format.
Declaration
public string ExtractText(int pageIndex, out List<TextData> textDataCollection)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | |
System.Collections.Generic.List<TextData> | textDataCollection |
Returns
Type | Description |
---|---|
System.String | Returns the extracted text for the provided page |
GetDocumentData(Dictionary<String, String>)
Declaration
public object GetDocumentData(Dictionary<string, string> jsonResult)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | jsonResult |
Returns
Type | Description |
---|---|
System.Object |
Load(PdfLoadedDocument)
Loads the PDF document from the PdfLoadedDocument object
Declaration
public void Load(PdfLoadedDocument loadedDocument)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedDocument | loadedDocument | The PdfLoadedDocument to be loaded in the PDF viewer |
Load(PdfLoadedDocument, Boolean)
Loads the PDF document from the PdfLoadedDocument object
Declaration
public void Load(PdfLoadedDocument loadedDocument, bool isExtractText)
Parameters
Type | Name | Description |
---|---|---|
PdfLoadedDocument | loadedDocument | The PdfLoadedDocument to be loaded in the PDF viewer |
System.Boolean | isExtractText | if true, then text will only be extrcated |
Load(Byte[])
Loads the PDF document from the byte array.
Declaration
public void Load(byte[] byteArray)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | byteArray | The byte array that contains the data for the PDF document |
Load(Byte[], String)
Loads the encrypted PDF document from the byte array.
Declaration
public void Load(byte[] byteArray, string password)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | byteArray | The byte array that contains the data for the PDF document |
System.String | password | The password to decrypt the PDF document. |
Load(Stream)
Loads the PDF document from the specified stream.
Declaration
public void Load(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream that contains the data of the PDF document |
Load(Stream, String)
Loads the encrypted PDF document from the specified stream.
Declaration
public void Load(Stream stream, string password)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream that contains the data of the PDF document |
System.String | password | The password to decrypt the PDF document. |
Load(String)
Loads the PDF document in the given path
Declaration
public void Load(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path of the PDF document |
Load(String, String)
Loads the encrypted PDF document
Declaration
public void Load(string filePath, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path of the encrypted PDF document |
System.String | password | The password to decrypt the PDF document. |
ProcessPdf(Dictionary<String, String>)
Declaration
public object ProcessPdf(Dictionary<string, string> jsonResult)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | jsonResult |
Returns
Type | Description |
---|---|
System.Object |
Unload()
Declaration
public void Unload()
UnLoad()
Unloads the PDF document being displayed in the PDF viewer control from server side.
Declaration
[Obsolete("UnLoad is deprecated, please use Unload instead.")]
public void UnLoad()
Unload(Dictionary<String, String>)
Unloads the PDF document being displayed in the PDF viewer control from server side.
Declaration
public void Unload(Dictionary<string, string> jsonResult)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | jsonResult |