moonbitlang/pdflite/page/label 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.

    PdfPageLabel

    pub(all) struct PdfPageLabel {
    label_style : PdfPageLabelStyle
    label_prefix : Bytes?
    start_page : Int
    start_value : Int
    } derive(Eq, ToJson,
    Debug
    )

    One page-label range.

    start_page is 1-based. start_value is the numeric value shown on that page before style formatting, and label_prefix is stored as PDF bytes.

    PdfPageLabel::equal

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

    PdfPageLabel::not_equal

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

    PdfPageLabel::to_json

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

    PdfPageLabel::to_repr

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

    PdfPageLabelStyle

    pub(all) enum PdfPageLabelStyle {
    PageLabelDecimalArabic
    PageLabelUppercaseRoman
    PageLabelLowercaseRoman
    PageLabelUppercaseLetters
    PageLabelLowercaseLetters
    PageLabelNoLabelPrefixOnly
    } derive(Eq, ToJson,
    Debug
    )

    Numbering style used for a page-label range.

    PageLabelNoLabelPrefixOnly means no numeric suffix is generated; only the optional prefix contributes to the visible label.

    PdfPageLabelStyle::debug_name

    fn PdfPageLabelStyle::debug_name(self : PdfPageLabelStyle) -> String

    Return a stable debug name for a page-label style.

    PdfPageLabelStyle::equal

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

    PdfPageLabelStyle::not_equal

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

    PdfPageLabelStyle::to_json

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

    PdfPageLabelStyle::to_repr

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

    pdf_page_label_basic

    let pdf_page_label_basic : PdfPageLabel

    Default decimal page-label range starting at page 1 with value 1.

    pdf_page_label_complete

    fn pdf_page_label_complete(labels : ArrayView[PdfPageLabel]) -> Array[PdfPageLabel]

    Ensure a label list has an initial range covering page 1.

    Empty lists or lists that start after page 1 receive pdf_page_label_basic.

    pdf_page_label_lowercase

    fn pdf_page_label_lowercase(bytes : Bytes) -> Bytes

    Lowercase ASCII A-Z bytes and preserve all other bytes unchanged.

    pdf_page_label_number_bytes

    fn pdf_page_label_number_bytes(number : Int, style : PdfPageLabelStyle) -> Bytes

    Format the numeric suffix for a page label style.

    Prefix-only labels return an empty byte string.

    pdf_page_label_of_page_number

    fn pdf_page_label_of_page_number(page_number : Int, labels : ArrayView[PdfPageLabel]) -> PdfPageLabel?

    Find the active page-label range for a 1-based page number.

    The input ranges are expected in document order. Returns None when the document has no page-label ranges.

    pdf_page_label_of_single

    fn pdf_page_label_of_single(page_number : Int, label : PdfPageLabel) -> PdfPageLabel

    Return the effective page-label range for one concrete page.

    The returned range keeps the style and prefix, but normalizes start_page and start_value to the numeric value displayed on page_number.

    pdf_page_label_roman_upper

    fn pdf_page_label_roman_upper(number : Int) -> Bytes

    Format a positive integer as uppercase Roman numeral bytes.

    Values less than or equal to zero produce an empty byte string, matching cpdf's page-label formatter behavior.

    pdf_page_label_style_of_string

    fn pdf_page_label_style_of_string(text : String) -> PdfPageLabelStyle raise
    PdfError

    Parse a debug-style page-label style name.

    Unknown names raise PdfError::PageLabelStyleExpected.

    pdf_page_label_text_of_page_number

    fn pdf_page_label_text_of_page_number(page_number : Int, labels : ArrayView[PdfPageLabel]) -> Bytes?

    Render the visible label text for a 1-based page number.

    Returns None when there are no label ranges. Label prefixes are returned as raw PDF bytes, preserving the encoding stored in the PDF string.

    pdf_page_label_text_of_single

    fn pdf_page_label_text_of_single(page_number : Int, label : PdfPageLabel) -> Bytes

    Render the visible label text for one page within a label range.

    The optional prefix bytes are copied first. The numeric suffix is calculated from the range's 1-based start_page and start_value, then formatted with the range style.

    pdf_string_of_page_label

    fn pdf_string_of_page_label(label : PdfPageLabel) -> Bytes

    Format a page-label range as a diagnostic byte string.