Click or drag to resize

PdfDecoder Class

A MultiFramedImageDecoder used to read PDF pages as images from a Stream.
Inheritance Hierarchy

Namespace:  Atalasoft.Imaging.Codec.Pdf
Assembly:  Atalasoft.dotImage.PdfReader (in Atalasoft.dotImage.PdfReader.dll) Version: (.NET 4.5.2, x86)
public class PdfDecoder : MultiFramedImageDecoder, IDisposable, 
	IMultiFramedVectorDecoder, IRegionReadable, ITextFormatDecoder

The PdfDecoder type exposes the following members.

Public methodPdfDecoder
Initializes a new instance of a PdfDecoder.
Public propertyPassword
The password for the PDF or null for no password
Public propertyStatic memberPathToResources
Public propertyRenderSettings
Used to indicate how to render the PDF. For example, whether to show Annotations and which ones to show.
Public propertyResolution
Gets or sets the resolution at which to render a PDF page.
Public propertySmoothingMode Obsolete.
Gets or sets a value specifying whether and how smoothing (antialiasing) is applied to lines, curves, and edges of filled areas and text.
Public propertySupportedImageType Obsolete.
Returns the ImageType that the implemented decoder class supports.
(Inherited from ImageDecoder.)
Public methodDispose
Releases all resources managed by this object.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by the PdfDecoder and optionally releases the managed resources
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodGetDefaultResolution
Public methodGetFrameCount
Returns the number of pages in a PDF document.
(Overrides MultiFramedImageDecoderGetFrameCount(Stream).)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetImageInfo(Stream)
Returns information about the first page of the PDF document.
(Overrides ImageDecoderGetImageInfo(Stream).)
Public methodGetImageInfo(Stream, Int32)
Returns information about the given page of the PDF document.
(Overrides MultiFramedImageDecoderGetImageInfo(Stream, Int32).)
Public methodGetTextDocument
Creates the text document.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsValidFormat
Returns true if and only if the specified Stream contains a PDF document.
(Overrides ImageDecoderIsValidFormat(Stream).)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRasterizeScaledRegion(Stream, RectangleF, SizeF, ProgressEventHandler)
Public methodRasterizeScaledRegion(Stream, Int32, RectangleF, SizeF, ProgressEventHandler)
Public methodRead(Stream, ProgressEventHandler)
Read a PDF document and return the first page as an AtalaImage.
(Overrides ImageDecoderRead(Stream, ProgressEventHandler).)
Public methodRead(Stream, Int32, ProgressEventHandler)
Read a PDF document and return the given page as an AtalaImage.
(Overrides MultiFramedImageDecoderRead(Stream, Int32, ProgressEventHandler).)
Public methodReadRegion
Reads a rectangle region from the PDF. This uses memory proportional to the size of the region.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public fieldStatic memberMAXRESOLUTION
The maximum resolution that PDF's can be read at.
Public fieldStatic memberMINRESOLUTION
The minimum resolution that PDF's can be read at.
To support reading JPEG2000 and JBIG2 compressed PDF files, you must distribute the Atalasoft.dotImage.Jbig2.dll and Atalasoft.dotImage.Jpeg2000.dll alongside your Atalasoft.dotImage.PdfReader.dll. However you are not required to distribute these dependencies if you do not wish to support JP2 or JBIG images within PDF files. This decoder unpacks PDFium engine library in %TEMP% directory by default. To set custom location see the example section.
[New Example] (C#)
using Atalasoft.Imaging;
using Atalasoft.Imaging.Codec;
using Atalasoft.Imaging.Codec.Pdf;
PdfDecoder pdf = new PdfDecoder();
pdf.Resolution = 150;
Workspace myWorkspace = new Workspace();
[New Example] (Visual Basic)
Imports Atalasoft.Imaging
Imports Atalasoft.Imaging.Codec
Imports Atalasoft.Imaging.Codec.Pdf
Dim pdf As PdfDecoder = New PdfDecoder()
pdf.Resolution = 150
Dim myWorkspace As Workspace = New Workspace()
To configure Pdfium library location, you should add the next line to app.config file:
    <PdfDecoder PdfiumLocation="C:\Folder\Subfolder\SubSubFolder"/>
    <!-- Components sections -->
You can also use a relaive path
    <PdfDecoder PdfiumLocation="..\Another\Sub\Folder"/>
    <!-- Components sections -->
See Also