This version of the module is deprecated: Use moonbitlang/pdflite instead
type PdfBytes = Bytespub struct BitStream {
input : ByteCursor
current_byte : Int
bit_mask : Int
bits_read : Int
} derive(Eq, ToJson, Debug)fn ByteCursor::ignore_until(self : ByteCursor, stop : (Int) -> Bool, eof_is_delimiter? : Bool) -> Unit raise PdfErrorfn ByteCursor::read_bytes_at(self : ByteCursor, position : Int, length : Int) -> Bytes raise PdfErrorfn ByteCursor::read_until_view(self : ByteCursor, stop : (Int) -> Bool, eof_is_delimiter? : Bool) -> BytesView raise PdfErrorfn ByteCursor::read_view_at(self : ByteCursor, position : Int, length : Int) -> BytesView raise PdfErrorfn ByteOutput::write_repeated_byte(self : ByteOutput, length : Int, value? : Int) -> Unit raise PdfErrorfn ByteOutput::write_view_at(self : ByteOutput, position : Int, bytes : BytesView) -> Unit raise PdfErrorfn ByteOutput::write_view_slice(self : ByteOutput, bytes : BytesView, offset : Int, length : Int) -> Unit raise PdfErrorpub(all) struct PdfAnnotation {
subtype : PdfAnnotationSubtype
contents : Bytes?
subject : Bytes?
rectangle : PdfRectangle
border : PdfAnnotationBorder
colour : PdfAnnotationColour?
rest : PdfObject
} derive(Eq, ToJson, Debug)pub(all) struct PdfAnnotationBorder {
width : Double
vertical_radius : Double
horizontal_radius : Double
style : PdfAnnotationStyle
dash_array : Array[Int]
} derive(Eq, ToJson, Debug)pub(all) enum PdfAnnotationSubtype {
AnnotationText
AnnotationLink
AnnotationFreeText
AnnotationLine
AnnotationSquare
AnnotationCircle
AnnotationPolygon
AnnotationPolyLine
AnnotationHighlight
AnnotationUnderline
AnnotationSquiggly
AnnotationStrikeOut
AnnotationStamp
AnnotationCaret
AnnotationInk
AnnotationPopup(PdfAnnotation)
AnnotationFileAttachment
AnnotationSound
AnnotationMovie
AnnotationWidget
AnnotationScreen
AnnotationPrinterMark
AnnotationTrapNet
AnnotationWatermark
AnnotationThreeDee
AnnotationUnknown(PdfName)
} derive(Eq, ToJson, Debug)pub(all) struct PdfBookmark {
level : Int
text : Bytes
target : PdfDestination
is_open : Bool
colour : PdfBookmarkColour
flags : Int
} derive(Eq, ToJson, Debug)pub(all) struct PdfCIDKeyedFont {
basefont : PdfName
composite : PdfCompositeCIDFont
encoding : PdfCMapEncoding
} derive(Eq, ToJson, Debug)pub(all) enum PdfCMapEncoding {
PdfPredefinedCMap(PdfName)
PdfCMap(Int)
PdfExternalCMap(Int, PdfParsedCMap)
} derive(Eq, ToJson, Debug)pub(all) struct PdfCalculatorFunction {
operations : Array[PdfCalculatorOp]
} derive(Eq, ToJson, Debug)pub(all) enum PdfCalculatorOp {
PdfCalculatorInt(Int)
PdfCalculatorFloat(Double)
PdfCalculatorAbs
PdfCalculatorAdd
PdfCalculatorAnd
PdfCalculatorAtan
PdfCalculatorBitshift
PdfCalculatorBool(Bool)
PdfCalculatorCeiling
PdfCalculatorCos
PdfCalculatorCopy
PdfCalculatorCvi
PdfCalculatorCvr
PdfCalculatorSub
PdfCalculatorMul
PdfCalculatorDiv
PdfCalculatorDup
PdfCalculatorExch
PdfCalculatorExp
PdfCalculatorFloor
PdfCalculatorIdiv
PdfCalculatorIf(Array[PdfCalculatorOp])
PdfCalculatorIfElse(Array[PdfCalculatorOp], Array[PdfCalculatorOp])
PdfCalculatorIndex
PdfCalculatorLn
PdfCalculatorLog
PdfCalculatorEq
PdfCalculatorGe
PdfCalculatorGt
PdfCalculatorLe
PdfCalculatorLt
PdfCalculatorMod
PdfCalculatorNe
PdfCalculatorNeg
PdfCalculatorNot
PdfCalculatorOr
PdfCalculatorPop
PdfCalculatorRoll
PdfCalculatorRound
PdfCalculatorSin
PdfCalculatorSqrt
PdfCalculatorTruncate
PdfCalculatorXor
} derive(Eq, ToJson, Debug)pub(all) enum PdfColourSpace {
PdfDeviceGray
PdfDeviceRGB
PdfDeviceCMYK
PdfCalGray(PdfTristimulusPoint, PdfTristimulusPoint, Double)
PdfCalRGB(PdfTristimulusPoint, PdfTristimulusPoint, Array[Double], Array[Double])
PdfLab(PdfTristimulusPoint, PdfTristimulusPoint, Array[Double])
PdfICCBased(Int, PdfColourSpace, Array[Double], PdfObject?, PdfObject)
PdfIndexed(PdfColourSpace, Array[(Int, Array[Int])])
PdfPattern
PdfPatternWithBaseColourSpace(PdfColourSpace)
PdfSeparation(PdfName, PdfColourSpace, PdfObject)
PdfDeviceN(Array[PdfName], PdfColourSpace, PdfObject, PdfObject)
} derive(Eq, ToJson, Debug)pub(all) struct PdfCompositeCIDFont {
cid_system_info : PdfCIDSystemInfo
cid_basefont : PdfName
cid_fontdescriptor : PdfFontDescriptor
cid_widths : Array[(Int, Double)]
cid_widths2 : Array[(Int, PdfCIDVerticalWidth)]
cid_default_width : Double
cid_default_width2 : Array[Double]
} derive(Eq, ToJson, Debug)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)pub(all) struct PdfDecryptionResult {
document : PdfDocument
denied_permissions : Array[PdfPermission]
} derive(Eq, ToJson, Debug)pub(all) enum PdfDestination {
DestAction(PdfObject)
DestNull
DestNamed(PdfName)
DestString(Bytes)
DestXYZ(PdfTargetPage, Double?, Double?, Double?)
DestFit(PdfTargetPage)
DestFitH(PdfTargetPage, Double?)
DestFitV(PdfTargetPage, Double?)
DestFitR(PdfTargetPage, Double, Double, Double, Double)
DestFitB(PdfTargetPage)
DestFitBH(PdfTargetPage, Double?)
DestFitBV(PdfTargetPage, Double?)
} derive(Eq, ToJson, Debug)pub struct PdfDocument {
major : Int
minor : Int
root : Int
objects : PdfObjects
trailer_dict : PdfObject
was_linearized : Bool
saved_encryption : PdfSavedEncryption?
first_xref : Int
revision_read : Int
} derive(Eq, ToJson, Debug)fn PdfDocument::add_annotation(self : PdfDocument, page : PdfPage, annotation : PdfAnnotation) -> PdfPage raise PdfErrorfn PdfDocument::add_bookmarks(self : PdfDocument, bookmarks : ArrayView[PdfBookmark]) -> PdfDocument raise PdfErrorfn PdfDocument::add_object_given_number(self : PdfDocument, number : Int, object : PdfObject, generation? : Int) -> Unitfn PdfDocument::add_root(self : PdfDocument, page_root_number : Int, extras : ArrayView[(PdfName, PdfObject)]) -> Int raise PdfErrorfn PdfDocument::annotations_of_page(self : PdfDocument, page : PdfPage) -> Array[PdfAnnotation] raise PdfErrorfn PdfDocument::build_name_tree(self : PdfDocument, entries : ArrayView[(Bytes, PdfObject)]) -> PdfObjectfn PdfDocument::build_number_tree(self : PdfDocument, entries : ArrayView[(Int, PdfObject)]) -> PdfObjectfn PdfDocument::change_id(self : PdfDocument, path : String, get_time : () -> Double) -> Unit raise PdfErrorfn PdfDocument::change_pages(self : PdfDocument, pages : ArrayView[PdfPage], change_references? : Bool, matrices? : ArrayView[(Int, TransformMatrix)], changes? : ArrayView[(Int, Int)]) -> PdfDocument raise PdfErrorfn PdfDocument::colour_space_components(self : PdfDocument, resources : PdfObject, object : PdfObject) -> Int raise PdfErrorfn PdfDocument::colspace(self : PdfDocument, image : PdfObject, resources : PdfObject) -> PdfColourSpace raise PdfErrorfn PdfDocument::combine_pdf_resources(self : PdfDocument, first : PdfObject, second : PdfObject) -> PdfObjectfn PdfDocument::contents_of_name_tree(self : PdfDocument, tree : PdfObject) -> Array[(PdfObject, PdfObject)]fn PdfDocument::decrypt_single_stream(self : PdfDocument, object_number : Int, generation : Int, stream : PdfObject, user_password? : BytesView?, owner_password? : BytesView?, no_encrypt_metadata? : Bool) -> PdfObject? raise PdfErrorfn PdfDocument::decrypt_with_owner_password(self : PdfDocument, password : BytesView, no_encrypt_metadata? : Bool) -> PdfDecryptionResult? raise PdfErrorfn PdfDocument::decrypt_with_passwords(self : PdfDocument, user_password? : BytesView?, owner_password? : BytesView?, no_encrypt_metadata? : Bool) -> PdfDecryptionResult? raise PdfErrorfn PdfDocument::decrypt_with_user_password(self : PdfDocument, password : BytesView, no_encrypt_metadata? : Bool) -> PdfDecryptionResult? raise PdfErrorfn PdfDocument::encrypt_128bit(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::encrypt_128bit_aesv2(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], encrypt_metadata? : Bool, file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::encrypt_128bit_aesv2_with_iv_provider(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], iv_provider : (Int, Int, Int) -> Bytes raise PdfError, encrypt_metadata? : Bool, file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::encrypt_128bit_r4(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], encrypt_metadata? : Bool, file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::encrypt_256bit_aesv3(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], iso? : Bool, encrypt_metadata? : Bool, file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::encrypt_256bit_aesv3_iso(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], encrypt_metadata? : Bool, file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::encrypt_256bit_aesv3_iso_with_providers(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], random_provider : (PdfAesV3RandomField, Int) -> Bytes raise PdfError, iv_provider : (Int, Int, Int) -> Bytes raise PdfError, encrypt_metadata? : Bool, file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::encrypt_256bit_aesv3_with_providers(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], random_provider : (PdfAesV3RandomField, Int) -> Bytes raise PdfError, iv_provider : (Int, Int, Int) -> Bytes raise PdfError, iso? : Bool, encrypt_metadata? : Bool, file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::encrypt_40bit(self : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], file_id? : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::get_image_24bpp(self : PdfDocument, resources : PdfObject, image : PdfObject) -> PdfImage raise PdfErrorfn PdfDocument::image_colour_space(self : PdfDocument, image : PdfObject, resources : PdfObject) -> PdfColourSpace raise PdfErrorfn PdfDocument::iter_objects(self : PdfDocument, callback : (Int, PdfObject) -> Unit raise) -> Unit raisefn PdfDocument::iter_objects_in_order(self : PdfDocument, callback : (Int, PdfObject) -> Unit raise) -> Unit raisefn PdfDocument::iter_objects_with_generation(self : PdfDocument, callback : (Int, Int, PdfObject) -> Unit raise) -> Unit raisefn PdfDocument::lookup_chain(self : PdfDocument, start : PdfObject, keys : ArrayView[PdfName]) -> PdfObject?fn PdfDocument::lookup_direct_or_array(self : PdfDocument, name : PdfName, object : PdfObject) -> PdfObject?fn PdfDocument::lookup_direct_or_else(self : PdfDocument, first_key : PdfName, second_key : PdfName, object : PdfObject) -> PdfObject?fn PdfDocument::lookup_required(self : PdfDocument, key : PdfName, object : PdfObject, error : PdfError) -> PdfObject raise PdfErrorfn PdfDocument::map_objects_in_place(self : PdfDocument, transform : (PdfObject) -> PdfObject) -> Unitfn PdfDocument::merge_name_trees_no_clash(self : PdfDocument, trees : ArrayView[PdfObject]) -> PdfObjectfn PdfDocument::merge_number_trees_no_clash(self : PdfDocument, trees : ArrayView[PdfObject]) -> PdfObjectfn PdfDocument::name_tree_lookup(self : PdfDocument, key : BytesView, tree : PdfObject) -> PdfObject?fn PdfDocument::name_tree_lookup_object(self : PdfDocument, key : PdfObject, tree : PdfObject) -> PdfObject?fn PdfDocument::page_number_of_target(self : PdfDocument, destination : PdfDestination) -> Int raise PdfErrorfn PdfDocument::parse_content_bytes_with_resources(self : PdfDocument, resources : PdfObject, data : Bytes) -> Array[PdfContentOp] raise PdfErrorfn PdfDocument::parse_content_ops(self : PdfDocument, streams : ArrayView[PdfObject]) -> Array[PdfContentOp] raise PdfErrorfn PdfDocument::parse_content_ops_with_resources(self : PdfDocument, resources : PdfObject, streams : ArrayView[PdfObject]) -> Array[PdfContentOp] raise PdfErrorfn PdfDocument::parse_content_view_with_resources(self : PdfDocument, resources : PdfObject, data : BytesView) -> Array[PdfContentOp] raise PdfErrorfn PdfDocument::parse_function(self : PdfDocument, function_object : PdfObject) -> PdfFunction raise PdfErrorfn PdfDocument::parse_matrix(self : PdfDocument, key : PdfName, object : PdfObject) -> TransformMatrix raise PdfErrorfn PdfDocument::parse_rectangle(self : PdfDocument, object : PdfObject) -> PdfRectangle raise PdfErrorfn PdfDocument::pdf_decode_stream(self : PdfDocument, object : PdfObject) -> PdfObject raise PdfErrorfn PdfDocument::pdf_decode_stream_until_unknown(self : PdfDocument, object : PdfObject) -> PdfObject raise PdfErrorfn PdfDocument::pdf_of_pages(self : PdfDocument, page_numbers : ArrayView[Int], retain_numbering? : Bool, process_struct_tree? : Bool) -> PdfDocument raise PdfErrorfn PdfDocument::postpend_operators(self : PdfDocument, page : PdfPage, ops : ArrayView[PdfContentOp], fast? : Bool) -> PdfPage raise PdfErrorfn PdfDocument::prepend_operators(self : PdfDocument, page : PdfPage, ops : ArrayView[PdfContentOp], fast? : Bool) -> PdfPage raise PdfErrorfn PdfDocument::process_xobjects(self : PdfDocument, page : PdfPage, process : (PdfDocument, PdfObject, ArrayView[PdfObject]) -> Array[PdfObject] raise PdfError) -> Unit raise PdfErrorfn PdfDocument::read_annotation(self : PdfDocument, annotation : PdfObject) -> PdfAnnotation raise PdfErrorfn PdfDocument::read_bookmarks(self : PdfDocument, preserve_actions? : Bool) -> Array[PdfBookmark] raise PdfErrorfn PdfDocument::read_cid_system_info(self : PdfDocument, dictionary : PdfObject) -> PdfCIDSystemInfo raise PdfErrorfn PdfDocument::read_cidkeyed_font(self : PdfDocument, font : PdfObject) -> PdfCIDKeyedFont raise PdfErrorfn PdfDocument::read_colour_space(self : PdfDocument, resources : PdfObject, object : PdfObject) -> PdfColourSpace? raise PdfErrorfn PdfDocument::read_destination(self : PdfDocument, object : PdfObject, shallow? : Bool) -> PdfDestination raise PdfErrorfn PdfDocument::read_font_descriptor(self : PdfDocument, font : PdfObject) -> PdfFontDescriptor? raise PdfErrorfn PdfDocument::read_font_metrics(self : PdfDocument, font : PdfObject) -> Array[Double]? raise PdfErrorfn PdfDocument::read_optional_content_groups(self : PdfDocument) -> PdfOptionalContent? raise PdfErrorfn PdfDocument::read_simple_font(self : PdfDocument, font : PdfObject) -> PdfSimpleFont raise PdfErrorfn PdfDocument::read_standard14_font(self : PdfDocument, font : PdfObject) -> PdfStandardFontData raise PdfErrorfn PdfDocument::recrypt_with_password(self : PdfDocument, password : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::recrypt_with_password_aesv2(self : PdfDocument, password : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::recrypt_with_password_aesv2_with_iv_provider(self : PdfDocument, password : BytesView, iv_provider : (Int, Int, Int) -> Bytes raise PdfError) -> PdfDocument raise PdfErrorfn PdfDocument::recrypt_with_password_aesv3(self : PdfDocument, password : BytesView) -> PdfDocument raise PdfErrorfn PdfDocument::recrypt_with_password_aesv3_with_iv_provider(self : PdfDocument, password : BytesView, iv_provider : (Int, Int, Int) -> Bytes raise PdfError) -> PdfDocument raise PdfErrorfn PdfDocument::referenced_object_numbers(self : PdfDocument, object : PdfObject, no_follow_entries? : ArrayView[PdfName], no_follow_contains? : ArrayView[(PdfName, PdfObject)]) -> Array[Int]fn PdfDocument::renumber_objects(self : PdfDocument, changes : ArrayView[(Int, Int)]) -> PdfDocument raise PdfErrorfn PdfDocument::renumber_objects_by_offset(self : PdfDocument, offset : Int) -> PdfDocument raise PdfErrorfn PdfDocument::renumber_pages(self : PdfDocument, pages : ArrayView[PdfPage]) -> Array[PdfPage] raise PdfErrorfn PdfDocument::replace_chain(self : PdfDocument, chain : ArrayView[PdfName], value : PdfObject) -> Unit raise PdfErrorfn PdfDocument::replace_inherit(self : PdfDocument, object_numbers : ArrayView[Int]) -> Unit raise PdfErrorfn PdfDocument::select_object_numbers(self : PdfDocument, predicate : (PdfObject) -> Bool) -> Array[Int]fn PdfDocument::target_of_page_number(self : PdfDocument, page_number : Int) -> PdfDestination raise PdfErrorfn PdfDocument::text_extractor_of_font(self : PdfDocument, font : PdfObject) -> PdfTextExtractor raise PdfErrorfn PdfDocument::transform_annotations(self : PdfDocument, matrix : TransformMatrix, rest : PdfObject) -> Unit raise PdfErrorfn PdfDocument::transform_bookmark(self : PdfDocument, matrix : TransformMatrix, bookmark : PdfBookmark) -> PdfBookmark raise PdfErrorfn PdfDocument::transform_destination(self : PdfDocument, matrix : TransformMatrix, destination : PdfDestination) -> PdfDestination raise PdfErrorfn PdfDocument::transform_quadpoints(self : PdfDocument, matrix : TransformMatrix, object : PdfObject) -> PdfObjectfn PdfDocument::transform_rect(self : PdfDocument, matrix : TransformMatrix, object : PdfObject) -> PdfObject raise PdfErrorfn PdfDocument::trim_structure_tree(self : PdfDocument, page_numbers : ArrayView[Int]) -> Unit raise PdfErrorfn PdfDocument::write_font(self : PdfDocument, font : PdfFont, objnum? : Int?) -> Int raise PdfErrorfn PdfDocument::write_optional_content_groups(self : PdfDocument, optional_content : PdfOptionalContent) -> PdfDocument raise PdfErrorfn PdfDocument::write_page_labels(self : PdfDocument, labels : ArrayView[PdfPageLabel]) -> PdfDocument raise PdfErrorpub(all) enum PdfEncoding {
PdfImplicitInFontFile
PdfStandardEncoding
PdfMacRomanEncoding
PdfWinAnsiEncoding
PdfMacExpertEncoding
PdfCustomEncoding(PdfEncoding, Array[PdfEncodingDifference])
PdfFillUndefinedWithStandard(PdfEncoding)
} derive(Eq, ToJson, Debug)pub(all) enum PdfFont {
PdfFontStandard(PdfStandardFontData)
PdfFontSimple(PdfSimpleFont)
PdfFontCIDKeyed(PdfCIDKeyedFont)
} derive(Eq, ToJson, Debug)pub(all) struct PdfFontDescriptor {
ascent : Double
descent : Double
avgwidth : Double
maxwidth : Double
flags : Int
fontbbox : PdfRectangle
italicangle : Double
capheight : Double
xheight : Double
stemv : Double
fontfile : PdfFontFile?
charset : Array[PdfName]?
tounicode : Array[(Int, Bytes)]?
} derive(Eq, ToJson, Debug)fn PdfFunction::eval(self : PdfFunction, inputs : ArrayView[Double]) -> Array[Double] raise PdfErrorpub(all) enum PdfFunctionKind {
PdfFunctionSampled(PdfSampledFunction)
PdfFunctionInterpolation(PdfInterpolationFunction)
PdfFunctionStitching(PdfStitchingFunction)
PdfFunctionCalculator(PdfCalculatorFunction)
} derive(Eq, ToJson, Debug)pub(all) enum PdfLexeme {
LexNull
LexBool(Bool)
LexInt(Int)
LexReal(Double)
LexString(Bytes)
LexName(PdfName)
LexLeftSquare
LexRightSquare
LexLeftDict
LexRightDict
LexStream(PdfStreamData)
LexEndStream
LexObj
LexEndObj
LexR
LexComment(Bytes)
StopLexing
LexNone
} derive(Eq, ToJson, Debug)pub struct PdfObjects {
max_object_number : Int
object_map : PdfObjectMap
object_stream_ids : HashMap[Int, Int]
log : Array[(Int, PdfObjectEvent)]
} derive(Eq, ToJson, Debug)fn PdfObjects::add_object_given_number(self : PdfObjects, number : Int, object : PdfObject, generation? : Int) -> Unitfn PdfObjects::map_objects_in_place(self : PdfObjects, transform : (PdfObject) -> PdfObject) -> Unitpub(all) struct PdfOcgConfig {
name : Bytes?
creator : Bytes?
base_state : PdfOcgState
on : Array[Int]
off : Array[Int]
intent : Array[PdfName]
usage_applications : Array[PdfOcgAppDict]
order : Array[(Bytes?, Array[Int])]?
list_mode : PdfOcgListMode
radio_button_groups : Array[Array[Int]]?
locked : Array[Int]
} derive(Eq, ToJson, Debug)pub(all) struct PdfOcgUsage {
creator_info : (Bytes, PdfName)?
language : (Bytes, PdfName?)?
export_state : PdfName?
zoom_min : Double?
zoom_max : Double?
print_subtype : PdfName?
print_state : PdfName?
view_state : PdfName?
user : (PdfName, Array[Bytes])?
page_element_subtype : PdfName?
} derive(Eq, ToJson, Debug)pub(all) struct PdfOptionalContent {
ocgs : Array[(Int, PdfOcg)]
default_config : PdfOcgConfig
configs : Array[PdfOcgConfig]
} derive(Eq, ToJson, Debug)pub(all) struct PdfPageLabel {
label_style : PdfPageLabelStyle
label_prefix : Bytes?
start_page : Int
start_value : Int
} derive(Eq, ToJson, Debug)pub(all) struct PdfSimpleFont {
fonttype : PdfSimpleFontType
basefont : PdfName?
firstchar : Int
lastchar : Int
widths : Array[Int]
fontdescriptor : PdfFontDescriptor?
fontmetrics : Array[Double]?
encoding : PdfEncoding
} derive(Eq, ToJson, Debug)pub(all) enum PdfSimpleFontType {
PdfType1
PdfMMType1
PdfType3(PdfType3Glyphs)
PdfTrueType
} derive(Eq, ToJson, Debug)fn PdfStandardFont::text_width(self : PdfStandardFont, encoding : PdfEncoding, text : BytesView, kern? : Bool) -> Intpub(all) struct PdfStandardFontData {
font : PdfStandardFont
encoding : PdfEncoding
} derive(Eq, ToJson, Debug)fn PdfStandardFontData::text_width(self : PdfStandardFontData, text : BytesView, kern? : Bool) -> Intfn PdfTextExtractor::codepoints_of_text(self : PdfTextExtractor, text : BytesView) -> Array[Int] raise PdfErrorfn PdfTextExtractor::glyphnames_and_codepoints_of_text(self : PdfTextExtractor, text : BytesView) -> Array[PdfTextGlyph] raise PdfErrorfn PdfTextExtractor::glyphnames_of_text(self : PdfTextExtractor, text : BytesView) -> Array[PdfName] raise PdfErrorpub(all) struct PdfType3Glyphs {
fontbbox : PdfRectangle
fontmatrix : TransformMatrix
charprocs : Array[(PdfName, PdfObject)]
resources : PdfObject
} derive(Eq, ToJson, Debug)pub(all) struct PdfWriteEncryption {
encryption_method : PdfEncryptionMethod
user_password : Bytes
owner_password : Bytes
denied_permissions : Array[PdfPermission]
} derive(Eq, ToJson, Debug)pub(all) struct ToGet {
input : ByteCursor
position : Int
length : Int
crypt : PdfStreamDataCrypt
} derive(Eq, ToJson, Debug)fn pdf_add_annotation(document : PdfDocument, page : PdfPage, annotation : PdfAnnotation) -> PdfPage raise PdfErrorfn pdf_add_bookmarks(bookmarks : ArrayView[PdfBookmark], document : PdfDocument) -> PdfDocument raise PdfErrorfn pdf_add_pagetree(pages : ArrayView[PdfPage], document : PdfDocument) -> (PdfDocument, Int) raise PdfErrorfn pdf_add_root(page_root_number : Int, extras : ArrayView[(PdfName, PdfObject)], document : PdfDocument) -> PdfDocument raise PdfErrorfn pdf_annotation_make(subtype : PdfAnnotationSubtype, contents? : Bytes?, border? : PdfAnnotationBorder, rectangle? : PdfRectangle, colour? : PdfAnnotationColour?, subject? : Bytes?) -> PdfAnnotationfn pdf_annotation_make_border(width : Double, vertical_radius? : Double, horizontal_radius? : Double, style? : PdfAnnotationStyle, dash_array? : ArrayView[Int]) -> PdfAnnotationBorderfn pdf_annotations_of_page(document : PdfDocument, page : PdfPage) -> Array[PdfAnnotation] raise PdfErrorfn pdf_ascii85_encode(data : Bytes) -> Bytesfn pdf_ascii85_encode_view(data : BytesView) -> Bytesfn pdf_ascii_hex_encode(data : Bytes) -> Bytesfn pdf_ascii_hex_encode_view(data : BytesView) -> Bytesfn pdf_build_name_tree(is_number : Bool, document : PdfDocument, entries : ArrayView[(Bytes, PdfObject)]) -> PdfObject raise PdfErrorfn pdf_bytes_copy(values : BytesView) -> Bytesfn pdf_bytes_get(bytes : Bytes, index : Int) -> Byte?fn pdf_bytes_length(bytes : Bytes) -> Intfn pdf_bytes_of_view(values : BytesView) -> Bytesfn pdf_bytes_to_fixed_array(bytes : Bytes) -> FixedArray[Byte]fn pdf_change_pages(change_references : Bool, document : PdfDocument, pages : ArrayView[PdfPage], matrices? : ArrayView[(Int, TransformMatrix)], changes? : ArrayView[(Int, Int)]) -> PdfDocument raise PdfErrorfn pdf_charcode_extractor_of_font(document : PdfDocument, font : PdfObject, debug? : Bool) -> ((Int) -> Int?) raise PdfErrorfn pdf_codepoints_of_text(extractor : PdfTextExtractor, text : BytesView) -> Array[Int] raise PdfErrorfn pdf_colour_space_components(document : PdfDocument, resources : PdfObject, object : PdfObject) -> Int raise PdfErrorfn pdf_decode_predictor(predictor : Int, colors : Int, bits_per_component : Int, columns : Int, data : Bytes) -> Bytes raise PdfErrorfn pdf_decode_predictor_view(predictor : Int, colors : Int, bits_per_component : Int, columns : Int, data : BytesView) -> Bytes raise PdfErrorfn pdf_deterministic_aes_iv_provider_from_seed(seed : BytesView) -> ((Int, Int, Int) -> Bytes raise PdfError)fn pdf_deterministic_aesv3_random_provider_from_seed(seed : BytesView) -> ((PdfAesV3RandomField, Int) -> Bytes raise PdfError)fn pdf_document_of_parsed_indirect_objects(objects : ArrayView[PdfParsedIndirectObject], version? : PdfVersion) -> PdfDocumentfn pdf_encode_predictor(predictor : Int, colors : Int, bits_per_component : Int, columns : Int, data : Bytes) -> Bytes raise PdfErrorfn pdf_encode_predictor_view(predictor : Int, colors : Int, bits_per_component : Int, columns : Int, data : BytesView) -> Bytes raise PdfErrorfn pdf_encode_stream_with_encoding(encoding : PdfStreamEncoding, object : PdfObject, only_if_smaller? : Bool, predictor? : PdfStreamPredictor?, predictor_columns? : Int, flate_level? : Int?) -> PdfObject raise PdfErrorfn pdf_eval_function(function : PdfFunction, inputs : ArrayView[Double]) -> Array[Double] raise PdfErrorfn pdf_flate_encode(data : Bytes) -> Bytesfn pdf_flate_encode_view(data : BytesView) -> Bytesfn pdf_get_image_24bpp(document : PdfDocument, resources : PdfObject, image : PdfObject) -> PdfImage raise PdfErrorfn pdf_glyphnames_of_text(extractor : PdfTextExtractor, text : BytesView) -> Array[PdfName] raise PdfErrorfn pdf_image_colspace(document : PdfDocument, image : PdfObject, resources : PdfObject) -> PdfColourSpace raise PdfErrorfn pdf_is_delimiter_byte(value : Int) -> Boolfn pdf_is_linearized(data : BytesView) -> Boolfn pdf_is_newline_byte(value : Int) -> Boolfn pdf_is_not_whitespace_byte(value : Int) -> Boolfn pdf_is_unicode_string(bytes : BytesView) -> Boolfn pdf_is_whitespace_byte(value : Int) -> Boolfn pdf_is_whitespace_or_delimiter_byte(value : Int) -> Boolfn pdf_make_hex_pdf_string(bytes : BytesView) -> Bytesfn pdf_make_pdf_string(bytes : BytesView) -> Bytesfn pdf_merge_documents(documents : ArrayView[PdfDocument], ranges : ArrayView[Array[Int]], retain_numbering? : Bool, retain_bookmarks? : Bool, retain_optional_content? : Bool, retain_acroforms? : Bool, retain_named_destinations? : Bool, retain_name_dictionary? : Bool, retain_structure_tree? : Bool, add_toplevel_document? : Bool, retain_info? : Bool, retain_catalog_entries? : Bool, remove_duplicate_fonts? : Bool) -> PdfDocument raise PdfErrorfn pdf_merge_number_trees_no_clash(document : PdfDocument, trees : ArrayView[PdfObject]) -> PdfObjectfn pdf_merge_pdfs(retain_numbering : Bool, remove_duplicate_fonts : Bool, names : ArrayView[String], documents : ArrayView[PdfDocument], ranges : ArrayView[Array[Int]], process_struct_trees? : Bool, add_toplevel_document? : Bool) -> PdfDocument raise PdfErrorfn pdf_merge_structure_trees(document : PdfDocument, documents : ArrayView[PdfDocument], add_toplevel_document? : Bool) -> Int? raise PdfErrorlet pdf_no_more : Intfn pdf_of_pages(document : PdfDocument, page_numbers : ArrayView[Int], retain_numbering? : Bool, process_struct_tree? : Bool) -> PdfDocument raise PdfErrorfn pdf_optional_content_merge(documents : ArrayView[PdfDocument]) -> PdfOptionalContent? raise PdfErrorfn pdf_page_label_add_label(end_page : Int, labels : ArrayView[PdfPageLabel], label : PdfPageLabel, range_end_page : Int) -> Array[PdfPageLabel]fn pdf_page_label_merge(pdfs : ArrayView[PdfDocument], ranges : ArrayView[Array[Int]]) -> Array[PdfPageLabel] raise PdfErrorfn pdf_page_label_of_page_number(page_number : Int, labels : ArrayView[PdfPageLabel]) -> PdfPageLabel?fn pdf_page_label_text_of_page_number(page_number : Int, labels : ArrayView[PdfPageLabel]) -> Bytes?fn[A, B, C] pdf_page_process_stub(process : (A, B) -> C raise, number : A, page : B) -> (C, A, TransformMatrix) raisefn pdf_pagenumber_of_target(document : PdfDocument, destination : PdfDestination) -> Int raise PdfErrorfn pdf_parse_function(document : PdfDocument, function_object : PdfObject) -> PdfFunction raise PdfErrorfn pdf_parse_indirect_object_lexemes(lexemes : ArrayView[PdfLexeme]) -> PdfParsedIndirectObject raise PdfErrorfn pdf_parse_indirect_objects(lexemes : ArrayView[PdfLexeme]) -> Array[PdfParsedIndirectObject] raise PdfErrorfn pdf_pdfdocencoding_byte_of_codepoint(codepoint : Int) -> Byte?fn pdf_postpend_operators(document : PdfDocument, operators : ArrayView[PdfContentOp], page : PdfPage, fast? : Bool) -> PdfPage raise PdfErrorfn pdf_prepend_operators(document : PdfDocument, operators : ArrayView[PdfContentOp], page : PdfPage, fast? : Bool) -> PdfPage raise PdfErrorfn pdf_read_bookmarks(document : PdfDocument, preserve_actions? : Bool) -> Array[PdfBookmark] raise PdfErrorfn pdf_read_classic_document_revision_from_bytes(data : Bytes, revision : Int) -> PdfDocument raise PdfErrorfn pdf_read_classic_document_revision_from_view(data : BytesView, revision : Int) -> PdfDocument raise PdfErrorfn pdf_read_colour_space(document : PdfDocument, resources : PdfObject, object : PdfObject) -> PdfColourSpace? raise PdfErrorfn pdf_read_destination(document : PdfDocument, object : PdfObject, shallow? : Bool) -> PdfDestination raise PdfErrorfn pdf_read_document_from_bytes_with_passwords(data : Bytes, user_password? : BytesView?, owner_password? : BytesView?) -> PdfDecryptionResult? raise PdfErrorfn pdf_read_document_from_view_with_passwords(data : BytesView, user_password? : BytesView?, owner_password? : BytesView?) -> PdfDecryptionResult? raise PdfErrorfn pdf_read_document_revision_from_bytes(data : Bytes, revision : Int) -> PdfDocument raise PdfErrorfn pdf_read_document_revision_from_bytes_with_passwords(data : Bytes, revision : Int, user_password? : BytesView?, owner_password? : BytesView?) -> PdfDecryptionResult? raise PdfErrorfn pdf_read_document_revision_from_view(data : BytesView, revision : Int) -> PdfDocument raise PdfErrorfn pdf_read_document_revision_from_view_with_passwords(data : BytesView, revision : Int, user_password? : BytesView?, owner_password? : BytesView?) -> PdfDecryptionResult? raise PdfErrorfn pdf_run_length_decode(data : Bytes) -> Bytesfn pdf_run_length_decode_view(data : BytesView) -> Bytesfn pdf_run_length_encode(data : Bytes) -> Bytesfn pdf_run_length_encode_view(data : BytesView) -> Bytesfn pdf_standard14_text_width(font : PdfStandardFont, encoding : PdfEncoding, text : BytesView, kern? : Bool) -> Intfn pdf_standard14_textwidth(kern : Bool, encoding : PdfEncoding, font : PdfStandardFont, text : BytesView) -> Intfn pdf_target_of_pagenumber(document : PdfDocument, page_number : Int) -> PdfDestination raise PdfErrorfn pdf_text_extractor_of_font(document : PdfDocument, font : PdfObject) -> PdfTextExtractor raise PdfErrorfn pdf_transform_annotations(document : PdfDocument, matrix : TransformMatrix, rest : PdfObject) -> Unit raise PdfErrorfn pdf_transform_bookmark(document : PdfDocument, matrix : TransformMatrix, bookmark : PdfBookmark) -> PdfBookmark raise PdfErrorfn pdf_transform_destination(document : PdfDocument, matrix : TransformMatrix, destination : PdfDestination) -> PdfDestination raise PdfErrorfn pdf_trim_structure_tree(document : PdfDocument, page_numbers : ArrayView[Int]) -> Unit raise PdfErrorfn pdf_write_document_incremental_update(original : Bytes, document : PdfDocument) -> Bytes raise PdfErrorfn pdf_write_document_incremental_update_with_compressed_xref_stream(original : Bytes, document : PdfDocument) -> Bytes raise PdfErrorfn pdf_write_document_incremental_update_with_generated_id(original : Bytes, document : PdfDocument, path : String, mode? : PdfWriteMode) -> Bytes raise PdfErrorfn pdf_write_document_incremental_update_with_mode(original : Bytes, document : PdfDocument, mode : PdfWriteMode) -> Bytes raise PdfErrorfn pdf_write_document_incremental_update_with_xref_stream(original : Bytes, document : PdfDocument) -> Bytes raise PdfErrorfn pdf_write_document_options(document : PdfDocument, encryption? : PdfWriteEncryption?, update_from? : Bytes?, make_id? : Bool, id_path? : String, mode? : PdfWriteMode, file_id? : BytesView, aes_iv_provider? : (Int, Int, Int) -> Bytes raise PdfError?, aesv3_random_provider? : (PdfAesV3RandomField, Int) -> Bytes raise PdfError?) -> Bytes raise PdfErrorfn pdf_write_document_with_generated_id(document : PdfDocument, path : String, mode? : PdfWriteMode) -> Bytes raise PdfErrorfn pdf_write_document_with_mode(document : PdfDocument, mode : PdfWriteMode) -> Bytes raise PdfErrorfn pdf_write_encrypted_128bit_document(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encrypted_128bit_r4_document(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], encrypt_metadata? : Bool, mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encrypted_40bit_document(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encrypted_aesv2_document(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], encrypt_metadata? : Bool, mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encrypted_aesv2_document_with_iv_provider(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], iv_provider : (Int, Int, Int) -> Bytes raise PdfError, encrypt_metadata? : Bool, mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encrypted_aesv3_document(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], iso? : Bool, encrypt_metadata? : Bool, mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encrypted_aesv3_document_with_providers(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], random_provider : (PdfAesV3RandomField, Int) -> Bytes raise PdfError, iv_provider : (Int, Int, Int) -> Bytes raise PdfError, iso? : Bool, encrypt_metadata? : Bool, mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encrypted_aesv3_iso_document(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], encrypt_metadata? : Bool, mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encrypted_aesv3_iso_document_with_providers(document : PdfDocument, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission], random_provider : (PdfAesV3RandomField, Int) -> Bytes raise PdfError, iv_provider : (Int, Int, Int) -> Bytes raise PdfError, encrypt_metadata? : Bool, mode? : PdfWriteMode, file_id? : BytesView) -> Bytes raise PdfErrorfn pdf_write_encryption(encryption_method : PdfEncryptionMethod, user_password : BytesView, owner_password : BytesView, denied_permissions : ArrayView[PdfPermission]) -> PdfWriteEncryptionfn pdf_write_hex_string(bytes : BytesView) -> Bytesfn pdf_write_literal_string(bytes : BytesView) -> Bytesfn pdf_write_ocg(document : PdfDocument, optional_content : PdfOptionalContent) -> PdfDocument raise PdfErrorfn pdf_write_page_labels(document : PdfDocument, labels : ArrayView[PdfPageLabel]) -> PdfDocument raise PdfErrorfn transform_append(after : ArrayView[TransformOp], before : ArrayView[TransformOp]) -> Array[TransformOp]fn transform_recompose_components(scale : Double, aspect : Double, rotation : Double, shear : Double, translate_x : Double, translate_y : Double) -> TransformMatrix