Package-level declarations

Types

Link copied to clipboard
data class IndirectObject(val number: Long, val generation: Int, val value: PdfObject)

An object as it appears in the body: number, generation, and the value.

Link copied to clipboard
fun interface IndirectResolver

Functional interface implemented by the document's xref-driven object cache.

Link copied to clipboard
class Lexer(val reader: ByteReader)

PDF Lexer (ISO 32000-1 §7.2).

Link copied to clipboard
class Parser(lexer: Lexer, resolver: IndirectResolver? = null)

Recursive-descent parser for PDF objects (ISO 32000-1 §7.3).

Link copied to clipboard
data class PdfArray(val items: List<PdfObject>) : PdfObject, List<PdfObject>
Link copied to clipboard
data class PdfBoolean(val value: Boolean) : PdfObject
Link copied to clipboard
Link copied to clipboard
data class PdfInt(val value: Long) : PdfObject
Link copied to clipboard
data class PdfName(val value: String) : PdfObject

PDF Name (always starts with "/"). Stored without the leading slash.

Link copied to clipboard
Link copied to clipboard
sealed class PdfObject

Sealed hierarchy of PDF value types (ISO 32000-1 §7.3).

Link copied to clipboard
data class PdfReal(val value: Double) : PdfObject
Link copied to clipboard
data class PdfReference(val objectNumber: Long, val generation: Int) : PdfObject

"N G R" — an indirect object reference. Use resolve with the document's resolver.

Link copied to clipboard
data class PdfStream(val dict: PdfDictionary, val rawBytes: ByteArray) : PdfObject

A stream object: a dictionary describing the stream + the raw (still-encoded) bytes. Decoding is deferred until someone calls a filter on it.

Link copied to clipboard
data class PdfString(val bytes: ByteArray) : PdfObject

A byte-level PDF string. bytes is the raw payload AFTER PDF escape processing (so backslash escapes inside literal strings are already resolved, and hex strings are already decoded to bytes).

Link copied to clipboard
sealed class Token
Link copied to clipboard
data class XrefAndTrailer(val entries: Map<Long, XrefEntry>, val trailer: PdfDictionary)

What XrefParser.parse returns: the merged entry table and the trailer dict.

Link copied to clipboard
sealed class XrefEntry

A cross-reference entry. Distinct subtypes for the three xref-entry kinds.

Link copied to clipboard
class XrefParser(reader: ByteReader)

Cross-reference table + trailer parser (ISO 32000-1 §7.5).