menu

ASP.NET MVC - EJ2

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfRenderer - ASP.NETMVC-EJ2 API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfRenderer

    Represents the root element of the PDF viewer in Syncfusion.PdfViewer.Portable library.

    Inheritance
    System.Object
    PdfRenderer
    Implements
    System.IDisposable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.EJ2.PdfViewer
    Assembly: Syncfusion.EJ2.PdfViewer.dll
    Syntax
    public class PdfRenderer : IDisposable

    Constructors

    PdfRenderer()

    Initializes a new instance of Syncfusion.EJ2.PdfViewer class.

    Declaration
    public PdfRenderer()

    Properties

    CacheManager

    Set the cache object for storing and retrieving PDF document data in the cache.

    Declaration
    public ICacheManager CacheManager { get; set; }
    Property Value
    Type
    ICacheManager

    FallbackFontCollection

    It is used to import the custom fonts into PDF Viewer.

    Declaration
    public Dictionary<string, Stream> FallbackFontCollection { get; set; }
    Property Value
    Type
    System.Collections.Generic.Dictionary<System.String, System.IO.Stream>

    PageCount

    Gets the page count of the PDF document

    Declaration
    public int PageCount { get; }
    Property Value
    Type
    System.Int32

    ReferencePath

    Specifics the pdfium reference path to the PDF Viewer.

    Declaration
    public static string ReferencePath { get; set; }
    Property Value
    Type
    System.String

    ScaleFactor

    Scales the page while rendering in the PDF Viewer control for improving the quality of the image. Positive float values can be set. Recommended Value is 1 or 1.5f. If the value is greater than the recommended value, there might be any distortion in the performance of the PDF Viewer.

    Declaration
    public float ScaleFactor { get; set; }
    Property Value
    Type
    System.Single

    Methods

    ClearCache(Dictionary<String, String>)

    Clear the Cache objects while closing the PdfViewer.

    Declaration
    public void ClearCache(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Dispose()

    Dispose the PDF document resources while closing the PdfViewer.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Dispose the PDF document resources while closing the PdfViewer.

    Declaration
    public void Dispose(bool isClearCurrentDocument)
    Parameters
    Type Name Description
    System.Boolean isClearCurrentDocument

    If true clears current PDF stream

    ExportAnnotation(Dictionary<String, String>)

    Gets the XFdf annotation as base64 string

    Declaration
    public string ExportAnnotation(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.String

    Returns the XFdf annotation as base64 string.

    ExportAsImage(Int32)

    Exports the specified page as Image

    Declaration
    public Bitmap ExportAsImage(int pageIndex)
    Parameters
    Type Name Description
    System.Int32 pageIndex

    The page index to be converted into image

    Returns
    Type Description
    System.Drawing.Bitmap

    Returns the specified page as Image

    ExportAsImage(Int32, Boolean)

    Exports the specified page as Image

    Declaration
    public Bitmap ExportAsImage(int pageIndex, bool isSkipAnnotations)
    Parameters
    Type Name Description
    System.Int32 pageIndex

    The page index to be converted into image

    System.Boolean isSkipAnnotations

    Whether need to keep the annotation of the page

    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, Boolean, Boolean)

    Exports the specified page as Image

    Declaration
    public Bitmap ExportAsImage(int pageIndex, SizeF customSize, bool keepAspectRatio, bool isSkipAnnotations)
    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

    System.Boolean isSkipAnnotations

    Whether need to keep the annotation 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, SizeF, Single, Single, Boolean, Boolean)

    Exports the specified page as Image

    Declaration
    public Bitmap ExportAsImage(int pageIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio, bool isSkipAnnotations)
    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

    System.Boolean isSkipAnnotations

    Whether need to keep the annotation 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, Boolean)

    Exports the specified pages as Images

    Declaration
    public Bitmap[] ExportAsImage(int startIndex, int endIndex, bool isSkipAnnotations)
    Parameters
    Type Name Description
    System.Int32 startIndex

    The starting page index

    System.Int32 endIndex

    The ending page index

    System.Boolean isSkipAnnotations

    Whether need to keep the annotation of the page

    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, Boolean, Boolean)

    Exports the specified pages as Images

    Declaration
    public Bitmap[] ExportAsImage(int startIndex, int endIndex, SizeF customSize, bool keepAspectRatio, bool isSkipAnnotations)
    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

    System.Boolean isSkipAnnotations

    Whether need to keep the annotation of the page

    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, SizeF, Single, Single, Boolean, Boolean)

    Exports the specified pages as Images

    Declaration
    public Bitmap[] ExportAsImage(int startIndex, int endIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio, bool isSkipAnnotations)
    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

    System.Boolean isSkipAnnotations

    Whether need to keep the annotation of the page

    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, Int32, Single, Single, Boolean)

    Exports the specified pages as Images with respect to dpi specified.

    Declaration
    public Bitmap[] ExportAsImage(int startIndex, int endIndex, float dpiX, float dpiY, bool isSkipAnnotations)
    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.

    System.Boolean isSkipAnnotations

    Whether need to keep the annotation of the page

    Returns
    Type Description
    System.Drawing.Bitmap[]

    Returns the specified pages as Images with custom resolution

    ExportAsImage(Int32, Single, Int32, Int32, Int32, Int32)

    Exports the specified page as tile Image

    Declaration
    public Bitmap ExportAsImage(int pageIndex, float zoomFactor, int tileXCount, int tileYCount, int tileX, int tileY)
    Parameters
    Type Name Description
    System.Int32 pageIndex

    Specifies the page Number

    System.Single zoomFactor

    Specifies the zoom Factor

    System.Int32 tileXCount

    Specifies the tiles x dimension of page

    System.Int32 tileYCount

    Specifies the tiles y dimension of page

    System.Int32 tileX

    Specifies the x co-orindate of the tiles matrix of page

    System.Int32 tileY

    Specifies the y co-orindate of the tiles matrix of page

    Returns
    Type Description
    System.Drawing.Bitmap

    Returns the specified page as Image

    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

    ExportAsImage(Int32, Single, Single, Boolean)

    Exports the specified page as Image with respect to dpi specified.

    Declaration
    public Bitmap ExportAsImage(int pageIndex, float dpiX, float dpiY, bool isSkipAnnotations)
    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.

    System.Boolean isSkipAnnotations

    Whether need to keep the annotation of the page

    Returns
    Type Description
    System.Drawing.Bitmap

    Returns the specified page as Image with custom resolution

    ExportAsImageForTileRendering(Int32, Single, Int32, Int32)

    Exports the specified page as Image

    Declaration
    public Bitmap[] ExportAsImageForTileRendering(int pageIndex, float zoomFactor, int tileXCount, int tileYCount)
    Parameters
    Type Name Description
    System.Int32 pageIndex

    The page index to be converted into image

    System.Single zoomFactor

    Specifies the zoom Factor

    System.Int32 tileXCount

    Specifies the tiles x dimension of page

    System.Int32 tileYCount

    Specifies the tiles y dimension of page

    Returns
    Type Description
    System.Drawing.Bitmap[]

    Returns the specified page as Image

    ExportFormFields(Dictionary<String, String>)

    Export the form fields value from the PDF documents

    Declaration
    public string ExportFormFields(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.String

    Returns the form fields value as JSON base64 string.

    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

    ExtractText(Int32, out List<TextData>, Boolean)

    Extracts text along with its format.

    Declaration
    public string ExtractText(int pageIndex, out List<TextData> textDataCollection, bool isLayout)
    Parameters
    Type Name Description
    System.Int32 pageIndex
    System.Collections.Generic.List<TextData> textDataCollection
    System.Boolean isLayout
    Returns
    Type Description
    System.String

    Returns the extracted text for the provided page

    ExtractTextWithPageSize(Int32, out Dictionary<Int32, PageTextData>)

    extracts text along with its format.

    Declaration
    public string ExtractTextWithPageSize(int pageIndex, out Dictionary<int, PageTextData> pageTextDataCollection)
    Parameters
    Type Name Description
    System.Int32 pageIndex
    System.Collections.Generic.Dictionary<System.Int32, PageTextData> pageTextDataCollection
    Returns
    Type Description
    System.String

    Returns the extracted text for the provided page

    GetAnnotationComments(Dictionary<String, String>)

    Gets the annotation comments of the document

    Declaration
    public object GetAnnotationComments(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.Object

    Returns the annotations comments as Json object

    GetBookmarks(Dictionary<String, String>)

    Gets the Bookmark Details

    Declaration
    public object GetBookmarks(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.Object

    Returns the Bookmark Details

    GetDocumentAsBase64(Dictionary<String, String>)

    Gets the PDF document as base64 string

    Declaration
    public string GetDocumentAsBase64(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.String

    Returns the PDF document as base64 string.

    GetDocumentText(Dictionary<String, String>)

    Gets the PDF document text details

    Declaration
    public object GetDocumentText(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.Object

    Returns PDF document text details

    GetPage(Dictionary<String, String>)

    Gets the specified page as Image

    Declaration
    public object GetPage(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.Object

    Returns the specified page as Json object

    GetPageDetails(Int32, Single)

    Gets the specified page details

    Declaration
    public object GetPageDetails(int pageNumber, float zoomFactor)
    Parameters
    Type Name Description
    System.Int32 pageNumber

    Specifies the page Number

    System.Single zoomFactor

    Specifies the zoom Factor

    Returns
    Type Description
    System.Object

    Returns the specified page details as object

    GetPageDetails(Int32, Single, Int32, Int32, Int32, Int32)

    Gets the specified page details

    Declaration
    public object GetPageDetails(int pageNumber, float zoomFactor, int tileXCount, int tileYCount, int tileX, int tileY)
    Parameters
    Type Name Description
    System.Int32 pageNumber

    Specifies the page Number

    System.Single zoomFactor

    Specifies the zoom Factor

    System.Int32 tileXCount

    Specifies the tiles x dimension of page

    System.Int32 tileYCount

    Specifies the tiles y dimension of page

    System.Int32 tileX

    Specifies the x co-orindate of the tiles matrix of page

    System.Int32 tileY

    Specifies the y co-orindate of the tiles matrix of page

    Returns
    Type Description
    System.Object

    Returns the specified page details as object

    GetPrintImage(Dictionary<String, String>)

    Gets the page as Image

    Declaration
    public object GetPrintImage(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.Object

    Returns the page as base64 String

    GetTaggedElements(Dictionary<String, String>)

    Returns a list of tagged elements in a PDF document for the given page index, which is zero-based.

    Declaration
    public List<object> GetTaggedElements(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type
    System.Collections.Generic.List<System.Object>

    GetThumbnailImages(Dictionary<String, String>)

    Gets the thumbnail images of the document.

    Declaration
    public object GetThumbnailImages(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type
    System.Object

    ImportAnnotation(Dictionary<String, String>)

    Gets the annotation from the document

    Declaration
    public object ImportAnnotation(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type Description
    System.Object

    Returns the annotations collections as Json object

    ImportFormFields(Dictionary<String, String>)

    Import the form fields value to the PDF documents

    Declaration
    public object ImportFormFields(Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Form fields value from the client

    Returns
    Type Description
    System.Object

    Returns the form fields value as JSON string.

    Load(Byte[])

    Loads the PDF document from the specified byte Array.

    Declaration
    public object Load(byte[] byteArray)
    Parameters
    Type Name Description
    System.Byte[] byteArray

    The byte Array that contains the data of the PDF document

    Returns
    Type
    System.Object

    Load(Byte[], String)

    Loads the encrypted PDF document from the specified byte Array.

    Declaration
    public object Load(byte[] byteArray, string password)
    Parameters
    Type Name Description
    System.Byte[] byteArray

    The byte Array that contains the data of the PDF document

    System.String password

    password for the PDF document

    Returns
    Type
    System.Object

    Load(Stream)

    Loads the PDF document from the specified stream.

    Declaration
    public object Load(Stream fileStream)
    Parameters
    Type Name Description
    System.IO.Stream fileStream

    The stream that contains the data of the PDF document

    Returns
    Type
    System.Object

    Load(Stream, Dictionary<String, String>)

    Loads the PDF document from the specified stream.

    Declaration
    public object Load(Stream fileStream, Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.IO.Stream fileStream

    The stream that contains the data of the PDF document

    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type
    System.Object

    Load(Stream, String)

    Loads the encrypted PDF document from the specified stream.

    Declaration
    public object Load(Stream fileStream, string password)
    Parameters
    Type Name Description
    System.IO.Stream fileStream

    The stream that contains the data of the PDF document

    System.String password

    password for the PDF document

    Returns
    Type
    System.Object

    Load(String)

    Loads a PDF document with the specified filepath

    Declaration
    public object Load(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The path for the Pdf document.

    Returns
    Type
    System.Object

    Load(String, Dictionary<String, String>)

    Loads a PDF document with the specified filepath

    Declaration
    public object Load(string filePath, Dictionary<string, string> jsonObject)
    Parameters
    Type Name Description
    System.String filePath

    The path for the Pdf document.

    System.Collections.Generic.Dictionary<System.String, System.String> jsonObject

    Current object from the client

    Returns
    Type
    System.Object

    Load(String, String)

    Loads the encrypted PDF document with the specified filepath

    Declaration
    public object Load(string filePath, string password)
    Parameters
    Type Name Description
    System.String filePath

    The path for the Pdf document.

    System.String password

    Password for the pdf document.

    Returns
    Type
    System.Object

    LoadLibrary(String)

    Loads external library

    Declaration
    public void LoadLibrary(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    library path

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved