klyn.io.pdf.PDFDocument.PDFDocument
constructor
public PDFDocument(path as Path, maximumStreamSize as Int = 67108864)
Description

Opens a PDF from a Path, with the same limits as the String overload.

Parameters
ParameterDescription
pathSource file.
maximumStreamSizeMaximum decoded bytes per stream.
Throws
  • IOException if the source cannot be read.
  • PDFException if the PDF cannot be decoded safely.
Example
try document = PDFDocument(Path.userHome.resolve("report.pdf")):
    print(document.pages[0].getText())