Class PdfToImageConverter
Class to convert the pdf to images.
Implements
Inherited Members
Namespace: Syncfusion.PdfToImageConverter
Assembly: Syncfusion.PdfToImageConverter.Portable.dll
Syntax
public class PdfToImageConverter : IDisposable
Constructors
PdfToImageConverter()
Initializes the members of the PdfToImageConverter class.
Declaration
public PdfToImageConverter()
PdfToImageConverter(Stream)
Intializes the members of the PdfToImageConverter class.
Declaration
public PdfToImageConverter(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream of the file |
PdfToImageConverter(Stream, string)
Intializes the members of the PdfToImageConverter class.
Declaration
public PdfToImageConverter(Stream stream, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Stream of the file |
| string | password | Pasword for the file |
Properties
PageCount
Gets the page count of the document.
Declaration
public int PageCount { get; }
Property Value
| Type |
|---|
| int |
ReferencePath
Gets or sets the reference path of the Pdfium library.
Declaration
public string ReferencePath { get; set; }
Property Value
| Type |
|---|
| 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 |
|---|
| float |
Methods
Convert(int, SizeF, bool, bool, bool)
Converts the specified page of the PDF document as stream.
Declaration
public Stream Convert(int pageIndex, SizeF customSize, bool keepAspectRatio, bool keepTransparency, bool isSkipAnnotations)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pageIndex | The page index of the document |
| SizeF | customSize | The custom size of the converted image |
| bool | keepAspectRatio | Whether need to maintain the pdf page size |
| bool | keepTransparency | Whether need to make the background of the page as transparent |
| bool | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
| Type | Description |
|---|---|
| Stream | Returns the specified page as stream with custom size |
Convert(int, bool, bool)
Converts the specified page of the PDF document as stream.
Declaration
public Stream Convert(int pageIndex, bool keepTransparency, bool isSkipAnnotations)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pageIndex | page index of the document |
| bool | keepTransparency | Whether the background of the page needs to be transparent |
| bool | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
| Type | Description |
|---|---|
| Stream | Returns the stream of the specified page |
Convert(int, int, SizeF, bool, bool, bool)
Converts the specified range of PDF document's pages as stream array.
Declaration
public Stream[] Convert(int startIndex, int endIndex, SizeF customSize, bool keepAspectRatio, bool keepTransparency, bool isSkipAnnotations)
Parameters
| Type | Name | Description |
|---|---|---|
| int | startIndex | The starting page index |
| int | endIndex | The ending page index |
| SizeF | customSize | The custom size for the converted image |
| bool | keepAspectRatio | Whether need to maintain the pdf page size |
| bool | keepTransparency | Whether need to make the background of the page as transparent |
| bool | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
| Type | Description |
|---|---|
| Stream[] | Returns the array of stream for the range of pages |
Convert(int, int, bool, bool)
Converts the specified range of PDF document's pages as stream array.
Declaration
public Stream[] Convert(int startIndex, int endIndex, bool keepTransparency, bool isSkipAnnotations)
Parameters
| Type | Name | Description |
|---|---|---|
| int | startIndex | The starting page index |
| int | endIndex | The ending page index |
| bool | keepTransparency | Whether need to make the background of the page as transparent |
| bool | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
| Type | Description |
|---|---|
| Stream[] | Returns the array of stream for the range of pages |
Convert(int, float, int, int, int, int)
Converts the specified page of the PDF document as stream.
Declaration
public Stream Convert(int pageIndex, float zoomFactor, int tileXCount, int tileYCount, int tileX, int tileY)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pageIndex | Specifies the page Number |
| float | zoomFactor | Specifies the zoom Factor |
| int | tileXCount | Specifies the tiles x dimension of page |
| int | tileYCount | Specifies the tiles y dimension of page |
| int | tileX | Specifies the x co-orindate of the tiles matrix of page |
| int | tileY | Specifies the y co-orindate of the tiles matrix of page |
Returns
| Type | Description |
|---|---|
| Stream | Returns the specified page as Image |
Dispose()
Disposes the pdf document.
Declaration
public void Dispose()
Load(Stream)
Loads the PDF document from the specified stream.
Declaration
public void Load(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Pdf file as stream |
Load(Stream, string)
Loads the PDF document from the specified stream.
Declaration
public void Load(Stream stream, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | Pdf file stream |
| string | password | Password of the stream |