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

Opens a PDF. Relative paths are resolved against the working directory.

Parameters
ParameterDescription
filenamePDF filename.
maximumStreamSizeMaximum decoded bytes per stream (64 MiB by default).
Throws
  • IOException if reading fails.
  • PDFException if the file is malformed, encrypted, exceeds the 512 MiB source / 256 MiB retained object-stream limits, or uses an unsupported feature.
Example
try document = PDFDocument("report.pdf"):
    print(document.pages.size)