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

    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).

    PdfRectangle

    A normalized rectangle in PDF user-space coordinates.

    min_x and min_y are always the lower bounds, and max_x and max_y are always the upper bounds. Parsers normalize PDF rectangle arrays whose coordinates are written in the opposite order.

    Point2

    A two-dimensional point in PDF user-space coordinates.

    PdfAddTextJustification

    pub(all) enum PdfAddTextJustification {
    PdfAddTextLeftJustify
    PdfAddTextCentreJustify
    PdfAddTextRightJustify
    } derive(Eq, ToJson,
    Debug
    )

    Text justification values used by cpdf's add-text positioning helpers.

    PdfAddTextJustification::equal

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

    PdfAddTextJustification::not_equal

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

    PdfAddTextJustification::to_json

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

    PdfAddTextJustification::to_repr

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

    PdfAddTextLinePlacement

    pub(all) struct PdfAddTextLinePlacement {
    origin :
    Point2

    base_rotation : Double
    text_rotation : Double
    rotation_offset :
    Point2

    horizontal_offset : Double
    vertical_offset : Double
    justification_offset : Double
    } derive(Eq, ToJson,
    Debug
    )

    Resolved placement values for one cpdf add-text line.

    PdfAddTextLinePlacement::equal

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

    PdfAddTextLinePlacement::not_equal

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

    PdfAddTextLinePlacement::to_json

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

    PdfAddTextLinePlacement::to_repr

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

    PdfAddTextLineWidths

    pub(all) struct PdfAddTextLineWidths {
    text_width : Double
    widths : Array[Double]
    longest_width : Double
    } derive(Eq, ToJson,
    Debug
    )

    Width measurements for one cpdf add-text line and its expanded paragraph.

    PdfAddTextLineWidths::equal

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

    PdfAddTextLineWidths::not_equal

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

    PdfAddTextLineWidths::to_json

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

    PdfAddTextLineWidths::to_repr

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

    PdfAddTextPreparedLine

    pub(all) struct PdfAddTextPreparedLine {
    text : String
    text_bytes : Bytes
    urls : Array[PdfAddTextUrl]
    expanded_lines : Array[String]
    expanded_line_bytes : Array[Bytes]
    widths : PdfAddTextLineWidths
    placement : PdfAddTextLinePlacement
    } derive(Eq, ToJson,
    Debug
    )

    One cpdf add-text line after replacement expansion, URL stripping, width measurement, and placement resolution.

    PdfAddTextPreparedLine::equal

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

    PdfAddTextPreparedLine::not_equal

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

    PdfAddTextPreparedLine::to_json

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

    PdfAddTextPreparedLine::to_repr

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

    PdfAddTextReplacementValues

    pub(all) struct PdfAddTextReplacementValues {
    page_number : Int
    end_page : Int
    filename : String
    page_label : String
    end_label : String
    bates : Int
    bates_pad : Int?
    bookmarks : Array[String]
    } derive(Eq, ToJson,
    Debug
    )

    Values used to build cpdf add-text replacement callbacks.

    PdfAddTextReplacementValues::equal

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

    PdfAddTextReplacementValues::not_equal

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

    PdfAddTextReplacementValues::to_json

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

    PdfAddTextReplacementValues::to_repr

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

    PdfAddTextResourceSetup

    Page resources prepared for one cpdf add-text line.

    PdfAddTextResourceSetup::equal

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

    PdfAddTextResourceSetup::not_equal

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

    PdfAddTextResourceSetup::to_json

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

    PdfAddTextResourceSetup::to_repr

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

    PdfAddTextRotation

    pub(all) enum PdfAddTextRotation {
    PdfAddTextRot0
    PdfAddTextRot90
    PdfAddTextRot180
    PdfAddTextRot270
    } derive(Eq, ToJson,
    Debug
    )

    Text rotation values used by cpdf's add-text positioning helpers.

    PdfAddTextRotation::equal

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

    PdfAddTextRotation::not_equal

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

    PdfAddTextRotation::to_json

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

    PdfAddTextRotation::to_repr

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

    PdfAddTextUrl

    pub(all) struct PdfAddTextUrl {
    url : String
    start : Int
    end : Int
    } derive(Eq, ToJson,
    Debug
    )

    A URL span parsed from cpdf add-text %URL[text|url] markup.

    start and end are byte offsets in the visible output line, matching OCaml cpdf's String.length accounting.

    PdfAddTextUrl::equal

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

    PdfAddTextUrl::not_equal

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

    PdfAddTextUrl::to_json

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

    PdfAddTextUrl::to_repr

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

    PdfAddTextUrlAnnotationGeometry

    Transformed geometry for one add-text URL annotation.

    PdfAddTextUrlAnnotationGeometry::equal

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

    PdfAddTextUrlAnnotationGeometry::not_equal

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

    PdfAddTextUrlAnnotationGeometry::to_json

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

    PdfAddTextUrlAnnotationGeometry::to_repr

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

    PdfAddTextUrlLine

    pub(all) struct PdfAddTextUrlLine {
    text : String
    urls : Array[PdfAddTextUrl]
    } derive(Eq, ToJson,
    Debug
    )

    One add-text line after stripping %URL[text|url] markup.

    PdfAddTextUrlLine::equal

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

    PdfAddTextUrlLine::not_equal

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

    PdfAddTextUrlLine::to_json

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

    PdfAddTextUrlLine::to_repr

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

    pdf_addtext_apply_justification_offset

    fn pdf_addtext_apply_justification_offset(rotation : PdfAddTextRotation, horizontal_offset : Double, vertical_offset : Double, justification_offset : Double) -> (Double, Double)

    Apply cpdf's scalar justification offset to (horizontal, vertical).

    pdf_addtext_diagonal_offsets

    fn pdf_addtext_diagonal_offsets(bounds :
    PdfRectangle
    , position :
    PdfPosition
    , rotation : PdfAddTextRotation, text_width : Double, horizontal_offset : Double, vertical_offset : Double, base_rotation : Double) -> (Double, Double)

    Adjust cpdf add-text offsets for diagonal and reverse-diagonal placement.

    pdf_addtext_get_urls_line

    fn pdf_addtext_get_urls_line(line : String) -> PdfAddTextUrlLine raise
    PdfError

    Strip cpdf add-text %URL[text|url] markup from one line.

    The returned URL spans use byte offsets in the stripped visible text, as in cpdf's get_urls_line helper.

    pdf_addtext_initial_line_offsets

    fn pdf_addtext_initial_line_offsets(position :
    PdfPosition
    , line_count : Int, line_spacing : Double, font_size : Double) -> (Double, Double)

    Return cpdf's initial (horizontal, vertical) offset for a multi-line add-text paragraph.

    pdf_addtext_justification_offset

    fn pdf_addtext_justification_offset(rotation : PdfAddTextRotation, longest_width : Double, width : Double, position :
    PdfPosition
    , justification : PdfAddTextJustification) -> Double

    Return cpdf's add-text justification offset for the current line.

    longest_width is the maximum rendered width among the expanded text lines, and width is the current line width.

    pdf_addtext_line_advance

    fn pdf_addtext_line_advance(rotation : PdfAddTextRotation, line_spacing : Double, font_size : Double) -> (Double, Double)

    Return cpdf's per-line (horizontal, vertical) advance for add-text.

    pdf_addtext_line_placement

    fn pdf_addtext_line_placement(bounds :
    PdfRectangle
    , position :
    PdfPosition
    , rotation : PdfAddTextRotation, text_width : Double, longest_width : Double, horizontal_offset : Double, vertical_offset : Double, justification : PdfAddTextJustification) -> PdfAddTextLinePlacement

    Resolve cpdf add-text placement values for one line.

    This combines cpdf's calculate_position, diagonal offset correction, justification offset application, explicit text rotation, and rotation-origin offset selection.

    pdf_addtext_rotation_offsets

    fn pdf_addtext_rotation_offsets(position :
    PdfPosition
    , rotation : PdfAddTextRotation, text_width : Double) -> (Double, Double)

    Return cpdf's rotation-dependent text origin offset.

    pdf_addtext_rotation_radians

    fn pdf_addtext_rotation_radians(rotation : PdfAddTextRotation) -> Double

    Convert cpdf add-text's explicit rotation enum to content rotation radians.