moonbitlang/pdflite/content does not have a README file

    PdfBytes

    type PdfBytes = Bytes

    PDF byte strings and byte streams.

    This is an alias for MoonBit Bytes because PDF strings and streams are byte sequences, not Unicode text. Use String only after an explicit PDF text decoding step.

    PdfError

    Error variants raised by pdflite parsing, writing, filtering, text, and encryption APIs.

    The variants intentionally stay specific enough for tests and callers to distinguish malformed input classes, while most public APIs expose them through the ordinary raise PdfError flow.

    PdfName

    A PDF name token stored as its raw bytes without the leading slash.

    Names are byte-oriented in the PDF file format. Keeping the original bytes avoids accidental UTF-16 or UTF-8 interpretation while still allowing explicit views and owned-byte access.

    PdfObject

    The core in-memory representation of a parsed PDF object.

    Strings and names are byte-oriented PDF values, not MoonBit Unicode strings. PdfIndirect(number) is an unresolved reference by object number; callers that need the referenced object should resolve it through a PdfDocument.

    PdfReal is written rounded (to six decimals below 0.0001 in magnitude, otherwise to twelve significant digits); PdfExactReal is written exactly, as the shortest decimal that reads back as the value (see pdf_write_exact_real), for numbers such as transformation coefficients that no fixed precision serves. The parser never produces PdfExactReal: what it writes reads back as PdfReal (or PdfInteger).

    TransformMatrix

    A PDF affine transform matrix.

    The fields correspond to PDF's six-operand matrix [a b c d e f], where a point is transformed as x' = a*x + c*y + e and y' = b*x + d*y + f.

    PdfContentOp

    pub(all) enum PdfContentOp {
    Op_w(Double)
    Op_J(Int)
    Op_j(Int)
    Op_M(Double)
    Op_d(Array[Double], Double)
    Op_ri(
    PdfName
    )
    Op_i(Double)
    Op_q
    Op_Q
    Op_cm(
    TransformMatrix
    )
    Op_m(Double, Double)
    Op_l(Double, Double)
    Op_c(Double, Double, Double, Double, Double, Double)
    Op_v(Double, Double, Double, Double)
    Op_y(Double, Double, Double, Double)
    Op_h
    Op_re(Double, Double, Double, Double)
    Op_S
    Op_s
    Op_f
    Op_F
    Op_fstar
    Op_B
    Op_Bstar
    Op_b
    Op_bstar
    Op_n
    Op_W
    Op_Wstar
    Op_BT
    Op_ET
    Op_Tc(Double)
    Op_Tw(Double)
    Op_Tz(Double)
    Op_TL(Double)
    Op_Tf(
    PdfName
    , Double)
    Op_Tr(Int)
    Op_Ts(Double)
    Op_Td(Double, Double)
    Op_TD(Double, Double)
    Op_Tm(
    TransformMatrix
    )
    Op_Tstar
    Op_Tj(Bytes)
    Op_TJ(
    PdfObject
    )
    Op_quote(Bytes)
    Op_double_quote(Double, Double, Bytes)
    Op_d0(Double, Double)
    Op_d1(Double, Double, Double, Double, Double, Double)
    Op_G(Double)
    Op_g(Double)
    Op_RG(Double, Double, Double)
    Op_rg(Double, Double, Double)
    Op_K(Double, Double, Double, Double)
    Op_k(Double, Double, Double, Double)
    Op_gs(
    PdfName
    )
    Op_CS(
    PdfName
    )
    Op_cs(
    PdfName
    )
    Op_SC(Array[Double])
    Op_sc(Array[Double])
    Op_SCN(Array[Double])
    Op_scn(Array[Double])
    Op_SCNName(
    PdfName
    , Array[Double])
    Op_scnName(
    PdfName
    , Array[Double])
    Op_sh(
    PdfName
    )
    Op_Do(
    PdfName
    )
    Op_InlineImage(
    PdfObject
    ,
    PdfObject
    ?, Bytes)
    Op_MP(
    PdfName
    )
    Op_DP(
    PdfName
    ,
    PdfObject
    )
    Op_BMC(
    PdfName
    )
    Op_BDC(
    PdfName
    ,
    PdfObject
    )
    Op_EMC
    Op_BX
    Op_EX
    Op_Unknown(Bytes)
    } derive(Eq, ToJson,
    Debug
    )

    Flat representation of PDF content stream operators.

    Text strings and unknown operators are stored as raw PDF bytes. Inline images carry their image dictionary, optional decode parameters, and image data; the parser decodes supported inline-image filters when it can do so safely.

    PdfContentOp::equal

    #deprecated("implicit trait-method promotion is being removed; call via the trait")
    fn PdfContentOp::equal(PdfContentOp, PdfContentOp) -> Bool

    PdfContentOp::not_equal

    #deprecated("implicit trait-method promotion is being removed; call via the trait")
    fn PdfContentOp::not_equal(x : PdfContentOp, y : PdfContentOp) -> Bool

    PdfContentOp::to_json

    #deprecated("implicit trait-method promotion is being removed; call via the trait")
    fn PdfContentOp::to_json(PdfContentOp) -> Json

    PdfContentOp::to_repr

    #deprecated("implicit trait-method promotion is being removed; call via the trait")
    fn PdfContentOp::to_repr(PdfContentOp) ->
    Repr

    pdf_content_add_artifacts

    fn pdf_content_add_artifacts(ops : ArrayView[PdfContentOp]) -> Array[PdfContentOp]

    Mark unmarked content operations as PDF/UA artifacts.

    This ports cpdftype.ml's add_artifacts pass. Existing marked-content sections entered with BDC are preserved as real content; unmarked runs are wrapped in /Artifact BMC ... EMC. Back-channel /BeginArtifact and /EndArtifact markers are converted to ordinary artifact marked content.

    pdf_content_begin_artifact

    fn pdf_content_begin_artifact() -> PdfContentOp

    Return the marked-content operation that begins a PDF/UA artifact.

    pdf_content_end_artifact

    fn pdf_content_end_artifact() -> PdfContentOp

    Return the marked-content operation that ends the current PDF/UA artifact.

    pdf_content_parse_known_section

    fn pdf_content_parse_known_section(operands : ArrayView[
    PdfObject
    ], operator : BytesView) -> PdfContentOp? raise
    PdfError

    Parse a recognized PDF content operator from already parsed operands.

    Unknown operators return None so callers can preserve their raw bytes.