Opens and returns a PDF document.
Opens and returns a PDF document.
The return value may be a failed Future:
* PdfInvalidException: the main dictionary could not be found. * PdfEncryptedException: the PDF is encrypted and so can't be loaded. * IOException: a low-level file error occurred.
Otherwise, the return value will be valid ... but any page in the pages
iterator may still return a failed Future.
This will only parse enough of the document to figure out how many pages there are. The pages method will parse the rest.
Be sure close the returned PdfDocument.