 |
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 Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.5
Syntaxpublic class PdfTool : IDisposable
Public Class PdfTool
Implements IDisposable
The PdfTool type exposes the following members.
Constructors| | Name | Description |
|---|
 | PdfTool | Initializes a new instance of the PdfTool class. |
Top
Properties| | Name | Description |
|---|
 | DocumentInformation |
PDF document information. Populated after the first operation that returns metadata (e.g.
GetPageCount, GetInfo).
|
 | EndPageNumber |
The 1-based page number where the current operation ends. The default value is 0, which means
the operation runs to the last page.
|
 | StartPageNumber |
The 1-based page number where the current operation starts. The default value is 1 (first page).
|
 | Timeout | Timeout in seconds for the current operation. Default 600 seconds. |
 | UserPassword | The user password used to open the PDF document for reading. Default null (no password). |
Top
Methods| | Name | Description |
|---|
 | Close | Releases the loaded document. |
 | Dispose |
Releases the loaded document, the same as Close.
Lets the PdfTool be used in a using statement.
Calling it after Close, or more than once, does nothing.
|
 | GetInfo | Gets the document information (title, author, page count, etc.). |
 | GetPageCount | Gets the number of pages in the loaded PDF document. |
 | Load(Byte) | Loads a PDF document from a byte array. |
 | Load(PdfDocument) | Loads an in-memory PdfDocument for reading. |
 | Load(Stream) | Loads a PDF document from a stream. |
  | Load(String) | Loads a PDF document from a file. |
 | Load(Byte, String) | Loads a password-protected PDF document from a byte array. |
 | Load(PdfDocument, String) | Loads an in-memory PdfDocument. The password is used to open the document. |
 | Load(Stream, String) | Loads a password-protected PDF document from a stream. |
 | Load(String, String) | Loads a password-protected PDF document from a file. |
Top
ExamplePdfToText tool = new PdfToText();
tool.Load("document.pdf");
int pages = tool.GetPageCount();
tool.Close();Dim tool As New PdfToText()
tool.Load("document.pdf")
Dim pages As Integer = tool.GetPageCount()
tool.Close()
See Also