Click or drag to resize
Pdf Library for .NET

PdfTool Class

Base class for the PDF tools that read an existing document through the native PDF engine (PdfToText, PdfRasterizer). Load a document with one of the Load overloads, then use the derived tool.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfTool
    SelectPdf.UniversalPdfRasterizer
    SelectPdf.UniversalPdfToText

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public class PdfTool

The PdfTool type exposes the following members.

Constructors
 NameDescription
Public methodPdfToolInitializes a new instance of the PdfTool class.
Top
Properties
 NameDescription
Public propertyDocumentInformation PDF document information. Populated after the first operation that returns metadata (e.g. GetPageCount, GetInfo).
Public propertyEndPageNumber The 1-based page number where the current operation ends. The default value is 0, which means the operation runs to the last page.
Public propertyStartPageNumber The 1-based page number where the current operation starts. The default value is 1 (first page).
Public propertyTimeoutTimeout in seconds for the current operation. Default 600 seconds.
Public propertyUserPasswordThe user password used to open the PDF document for reading. Default null (no password).
Top
Methods
 NameDescription
Public methodGetInfoGets the document information (title, author, page count, etc.).
Public methodGetPageCountGets the number of pages in the loaded PDF document.
Public methodLoad(Byte)Loads a PDF document from a byte array.
Public methodLoad(PdfDocument)Loads an in-memory PdfDocument for reading.
Public methodLoad(Stream)Loads a PDF document from a stream.
Public methodCode exampleLoad(String)Loads a PDF document from a file.
Public methodLoad(Byte, String)Loads a password-protected PDF document from a byte array.
Public methodLoad(PdfDocument, String)Loads an in-memory PdfDocument. The password is used to open the document.
Public methodLoad(Stream, String)Loads a password-protected PDF document from a stream.
Public methodLoad(String, String)Loads a password-protected PDF document from a file.
Top
Example
PdfToText tool = new PdfToText();   // a concrete PdfTool
tool.Load("document.pdf");
int pages = tool.GetPageCount();
tool.Close();
See Also