Class PdfToImageConverter
Class to convert the pdf to images.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.PdfToImageConverter
Assembly: Syncfusion.PdfToImageConverter.Base.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 |
---|---|---|
System.IO.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 |
---|---|---|
System.IO.Stream | stream | Stream of the file |
System.String | password | Pasword for the file |
Properties
PageCount
Gets the page count of the document.
Declaration
public int PageCount { get; }
Property Value
Type |
---|
System.Int32 |
ReferencePath
Gets or sets the reference path of the Pdfium library.
Declaration
public string ReferencePath { get; set; }
Property Value
Type |
---|
System.String |
Methods
Convert(Int32, Boolean, Boolean)
Converts the specified page of the PDF document as stream.
Declaration
public Stream Convert(int pageIndex, bool keepTransparency, bool isSkipAnnotations)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | page index of the document |
System.Boolean | keepTransparency | Whether the background of the page needs to be transparent |
System.Boolean | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
Type | Description |
---|---|
System.IO.Stream | Returns the stream of the specified page |
Convert(Int32, SizeF, Boolean, Boolean, Boolean)
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 |
---|---|---|
System.Int32 | pageIndex | The page index of the document |
System.Drawing.SizeF | customSize | The custom size of the converted image |
System.Boolean | keepAspectRatio | Whether need to maintain the pdf page size |
System.Boolean | keepTransparency | Whether need to make the background of the page as transparent |
System.Boolean | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
Type | Description |
---|---|
System.IO.Stream | Returns the specified page as stream with custom size |
Convert(Int32, SizeF, Single, Single, Boolean, Boolean, Boolean)
Converts the specified page of the PDF document as stream.
Declaration
public Stream Convert(int pageIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio, bool keepTransparency, bool isSkipAnnotations)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | Page index of the document |
System.Drawing.SizeF | customSize | The custom size of the converted image |
System.Single | dpiX | The horizontal DPI of the resultant System.Drawing.Bitmap. |
System.Single | dpiY | The vertical DPI of the resultant System.Drawing.Bitmap. |
System.Boolean | keepAspectRatio | Whether need to maintain the pdf page size |
System.Boolean | keepTransparency | Whether need to make the background of the page as transparent |
System.Boolean | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
Type | Description |
---|---|
System.IO.Stream | Returns the stream of the specified page |
Convert(Int32, Int32, Boolean, Boolean)
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 |
---|---|---|
System.Int32 | startIndex | The starting page index |
System.Int32 | endIndex | The ending page index |
System.Boolean | keepTransparency | Whether need to make the background of the page as transparent |
System.Boolean | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
Type | Description |
---|---|
System.IO.Stream[] | Returns the array of stream for the range of pages |
Convert(Int32, Int32, SizeF, Boolean, Boolean, Boolean)
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 |
---|---|---|
System.Int32 | startIndex | The starting page index |
System.Int32 | endIndex | The ending page index |
System.Drawing.SizeF | customSize | The custom size for the converted image |
System.Boolean | keepAspectRatio | Whether need to maintain the pdf page size |
System.Boolean | keepTransparency | Whether need to make the background of the page as transparent |
System.Boolean | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
Type | Description |
---|---|
System.IO.Stream[] | Returns the array of stream for the range of pages |
Convert(Int32, Int32, SizeF, Single, Single, Boolean, Boolean, Boolean)
Converts the specified range of PDF document's pages as stream array.
Declaration
public Stream[] Convert(int startIndex, int endIndex, SizeF customSize, float dpiX, float dpiY, bool keepAspectRatio, bool keepTransparency, 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 System.Drawing.Bitmap. |
System.Single | dpiY | The vertical DPI of the resultant System.Drawing.Bitmap. |
System.Boolean | keepAspectRatio | Whether need to maintain the pdf page size |
System.Boolean | keepTransparency | Whether need to make the background of the page as transparent |
System.Boolean | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
Type | Description |
---|---|
System.IO.Stream[] | Returns the array of stream for the range of pages |
Convert(Int32, Int32, Single, Single, Boolean, Boolean)
Converts the specified range of PDF document's pages as stream array.
Declaration
public Stream[] Convert(int startIndex, int endIndex, float dpiX, float dpiY, bool keepTransparency, 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 System.Drawing.Bitmap. |
System.Single | dpiY | The vertical DPI of the resultant System.Drawing.Bitmap. |
System.Boolean | keepTransparency | Whether need to make the background of the page as transparent |
System.Boolean | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
Type | Description |
---|---|
System.IO.Stream[] | Returns the array of stream for the range of pages |
Convert(Int32, Single, Single, Boolean, Boolean)
Converts the specified page of the PDF document as stream.
Declaration
public Stream Convert(int pageIndex, float dpiX, float dpiY, bool keepTransparency, bool isSkipAnnotations)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageIndex | Page index of the document |
System.Single | dpiX | The horizontal DPI of the resultant System.Drawing.Bitmap. |
System.Single | dpiY | The vertical DPI of the resultant System.Drawing.Bitmap. |
System.Boolean | keepTransparency | Whether the background of the page needs to be transparent |
System.Boolean | isSkipAnnotations | Whether need to keep the annotation of the page |
Returns
Type | Description |
---|---|
System.IO.Stream | Returns the stream of the specified page |
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 |
---|---|---|
System.IO.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 |
---|---|---|
System.IO.Stream | stream | Pdf file stream |
System.String | password | Password of the stream |