Class PdfDocument
java.lang.Object
com.northconcepts.datapipeline.pdf.PdfDocument
- All Implemented Interfaces:
AutoCloseable
A PDF file or stream whose tables are extracted from every page when it is opened, for reading with a
PdfReader.
It cannot be opened again once closed.-
Constructor Summary
ConstructorsConstructorDescriptionCreates an unopened document; load it with one of theopenmethods.PdfDocument(File file) Deprecated.use open(File file)PdfDocument(File file, String password) Deprecated.use open(File file, String password) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the page, image and text statistics (computed once, then cached) or null if none are cached and the document is not open.getFile()Returns the file the document was loaded from or null if it was loaded from a stream or not loaded yet.intReturns the number of tables extracted from the document (0 before it is opened or after it is closed).open()Deprecated.use open(File file) or open(InputStream inputStream)Loads the PDF file and extracts its tables.Loads the PDF file using the password (null for none) and extracts its tables.open(InputStream inputStream) Loads the PDF from the stream and extracts its tables.open(InputStream inputStream, String password) Loads the PDF from the stream using the password (null for none) and extracts its tables.
-
Constructor Details
-
PdfDocument
Deprecated.use open(File file) -
PdfDocument
Deprecated.use open(File file, String password) -
PdfDocument
public PdfDocument()Creates an unopened document; load it with one of theopenmethods.
-
-
Method Details
-
open
Loads the PDF file and extracts its tables. -
open
Loads the PDF file using the password (null for none) and extracts its tables. -
open
Loads the PDF from the stream and extracts its tables. -
open
Loads the PDF from the stream using the password (null for none) and extracts its tables. -
open
Deprecated.use open(File file) or open(InputStream inputStream) -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
getTableCount
public int getTableCount()Returns the number of tables extracted from the document (0 before it is opened or after it is closed). -
getFile
Returns the file the document was loaded from or null if it was loaded from a stream or not loaded yet. -
getDocumentStatistics
Returns the page, image and text statistics (computed once, then cached) or null if none are cached and the document is not open.
-