Package-level declarations

Types

Link copied to clipboard

Builds a page content stream (ISO 32000-1 §8–§9) from typed drawing operations, emitting the raw operator bytes. Each PDF operator takes its operands first, then the operator keyword: r g b rg, x y m, (str) Tj.

Link copied to clipboard

Serializes a list of Operations back to content-stream bytes — the inverse of io.github.yuroyami.kitepdf.content.ContentStreamParser. Each operation writes its operands (space-separated, via PdfObjectWriter) then the operator keyword; inline images are written back verbatim from their captured source.

Link copied to clipboard

Creates a brand-new PDF from scratch — the full (non-incremental) write path.

Link copied to clipboard
class PdfEditor

Writer for edits to an existing PDF. Open one with PdfDocument.edit.

Link copied to clipboard
class PdfImage

An image ready to embed in a PdfBuilder page via ContentStreamBuilder.drawImage.

Link copied to clipboard

Serializes the PdfObject model back to spec-compliant PDF syntax (ISO 32000-1 §7.3) — the inverse of io.github.yuroyami.kitepdf.parser.Parser.

Link copied to clipboard
object PdfStreams

Builders for stream objects to hand to the writer (PdfEditor).

Link copied to clipboard

The 14 standard Type 1 fonts (ISO 32000-1 §9.6.2.2) that every conforming reader provides, so they need no embedding. baseFont is the /BaseFont name written into the font dictionary.

Functions

Link copied to clipboard
fun StandardFont.stringWidth(text: String, fontSize: Double, fallbackWidth: Int = 500): Double

Width of text set in this StandardFont at fontSize, in text-space units (points when the font size is in points) — the writer-side counterpart of a reader's glyph-advance sum.