This version of the module is deprecated: Use moonbitlang/pdflite instead
pub(all) suberror PdfError {
InvalidByte(Int)
InvalidCursorPosition(Int)
InvalidReadLength(Int)
InvalidBit(Int)
InvalidBitCount(Int)
MatrixNotInvertable
DictionaryExpected
DictionaryKeyNotFound(PdfName)
NumberExpected
RectangleExpected
BadRectangle
MatrixMalformed
InvalidHexEscape
InvalidASCII85Data
FilterNotSupported(PdfName)
FilterExpected
CCITTDecodeParmsExpected
CCITTNotSupported(String)
InvalidCCITTData
PredictorExpected
PredictorNotSupported(Int)
InvalidLZWData
InvalidFlateData
ParseObjectExpected
ParseArrayMalformed
ParseSingleObjectExpected
ParseIndirectObjectExpected
ParseEndObjectExpected
ParseStreamExpected
ParseEndStreamExpected
StreamLengthExpected
StreamDataExpected
ParsedObjectExpected
PageTreeExpected
PageRotationExpected(Int)
ContentOperatorExpected
ContentOperandExpected
FunctionExpected
FunctionNotSupported(Int)
BadFunctionEvaluation(String)
StartXRefExpected
XRefExpected
XRefEntryExpected
TrailerExpected
RootExpected
BadRevision
InvalidObjectNumber(Int)
BadDate
InvalidUnicodeCodepoint(Int)
InvalidUTF16BE
InvalidUTF8
InvalidPDFDocEncoding(Int)
CryptoKeyExpected
InvalidCryptoDataLength(Int)
EncryptionExpected
EncryptionMethodExpected
EncryptionDictionaryEntryExpected(PdfName)
EncryptionDictionaryEntryTooShort(PdfName)
EncryptionIDExpected
EncryptionAuthenticationUnsupported(PdfCryptType)
EncryptionObjectCryptUnsupported(PdfCryptType)
EncryptionSavedStateExpected
EncryptionRecryptUnsupported(PdfCryptType)
EncryptionRecryptFailed
EncryptionPermissionsCorrupt
EncryptionPermissionsMismatch(Int, Int)
RandomBytesUnavailable
EncodingExpected
EncodingDifferencesMalformed
EncodingWriteUnsupported
FontSubtypeExpected
FontFlagsExpected
StandardFontExpected
BaseFontExpected
FontFirstCharExpected
FontLastCharExpected
FontWidthsExpected
FontWidthExpected
FontCharProcsExpected
FontTypeExpected
FontWriteUnsupported
AfmExpected
ColourSpaceExpected
BadText
CIDSystemInfoExpected
CIDRegistryExpected
CIDOrderingExpected
CIDSupplementExpected
CIDBaseFontExpected
CIDFontDescriptorExpected
CIDWidthsExpected
CIDWidths2Expected
DescendantFontExpected
CMapEncodingExpected
PageLabelStyleExpected(String)
EndOfInput
} derive(Eq, ToJson, Debug)pub 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::aesv2_decrypt_parsed_objects(self : PdfDocument, file_key : BytesView, key_length_bits : Int, no_encrypt_metadata? : Bool, skip_object_number? : Int) -> PdfDocument raise PdfErrorfn PdfDocument::aesv2_encrypt_parsed_objects_with_iv_provider(self : PdfDocument, file_key : BytesView, key_length_bits : Int, iv_provider : (Int, Int, Int) -> Bytes raise PdfError, no_encrypt_metadata? : Bool, skip_object_number? : Int) -> PdfDocument raise PdfErrorfn PdfDocument::aesv3_decrypt_parsed_objects(self : PdfDocument, file_key : BytesView, no_encrypt_metadata? : Bool, skip_object_number? : Int) -> PdfDocument raise PdfErrorfn PdfDocument::aesv3_encrypt_parsed_objects_with_iv_provider(self : PdfDocument, file_key : BytesView, iv_provider : (Int, Int, Int) -> Bytes raise PdfError, no_encrypt_metadata? : Bool, skip_object_number? : Int) -> PdfDocument raise PdfErrorfn PdfDocument::annotations_of_page(self : PdfDocument, page : PdfPage) -> Array[PdfAnnotation] raise PdfErrorfn PdfDocument::arc4_crypt_parsed_objects(self : PdfDocument, file_key : BytesView, key_length_bits : Int, no_encrypt_metadata? : Bool, skip_object_number? : Int) -> PdfDocument 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::set_saved_encryption(self : PdfDocument, saved_encryption : PdfSavedEncryption?) -> Unitfn 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) struct PdfEncryptionValues {
crypt_type : PdfCryptType
user_entry : Bytes
owner_entry : Bytes
permissions : Int
file_id : Bytes
encrypt_metadata : Bool
permissions_entry : Bytes?
user_encryption_key : Bytes?
owner_encryption_key : Bytes?
} derive(Eq, ToJson, Debug)fn PdfEncryptionValues::authenticate_owner_password(self : PdfEncryptionValues, password : BytesView, no_encrypt_metadata? : Bool) -> Bool raise PdfErrorfn PdfEncryptionValues::authenticate_user_password(self : PdfEncryptionValues, password : BytesView, no_encrypt_metadata? : Bool) -> Bool raise PdfErrorfn PdfEncryptionValues::file_key_for_owner_password(self : PdfEncryptionValues, password : BytesView, no_encrypt_metadata? : Bool) -> Bytes? raise PdfErrorfn PdfEncryptionValues::file_key_for_user_password(self : PdfEncryptionValues, password : BytesView, no_encrypt_metadata? : Bool) -> Bytes? raise PdfErrorpub(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 ToGet {
input : ByteCursor
position : Int
length : Int
crypt : PdfStreamDataCrypt
} derive(Eq, ToJson, Debug)fn pdf_aes_cbc_decrypt(key : BytesView, data : BytesView, remove_padding? : Bool) -> Bytes raise PdfErrorfn pdf_aes_cbc_encrypt_with_iv(key : BytesView, iv : BytesView, data : BytesView) -> Bytes raise PdfErrorfn pdf_aes_ecb_decrypt(key : BytesView, data : BytesView, remove_padding? : Bool) -> Bytes raise PdfErrorfn pdf_aesv2_decrypt_object_data(object_number : Int, generation : Int, file_key : BytesView, key_length_bits : Int, data : BytesView) -> Bytes raise PdfErrorfn pdf_aesv2_encrypt_object_data(object_number : Int, generation : Int, file_key : BytesView, key_length_bits : Int, data : BytesView, iv : BytesView) -> Bytes raise PdfErrorfn pdf_aesv3_encrypt_object_data(file_key : BytesView, data : BytesView, iv : BytesView) -> Bytes 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_arc4_crypt_object(object_number : Int, generation : Int, file_key : BytesView, key_length_bits : Int, data : BytesView) -> Bytes raise PdfErrorfn pdf_authenticate_owner_password(no_encrypt_metadata : Bool, owner_password : BytesView, revision : Int, user_entry : BytesView, owner_entry : BytesView, permissions : Int, file_id : BytesView, key_length_bits : Int) -> Bool raise PdfErrorfn pdf_authenticate_owner_password_aesv3(iso : Bool, password : BytesView, user_entry : BytesView, owner_entry : BytesView) -> Bool raise PdfErrorfn pdf_authenticate_user_password(no_encrypt_metadata : Bool, user_password : BytesView, revision : Int, user_entry : BytesView, owner_entry : BytesView, permissions : Int, file_id : BytesView, key_length_bits : Int) -> Bool raise PdfErrorfn pdf_authenticate_user_password_aesv3(iso : Bool, password : BytesView, user_entry : BytesView) -> Bool 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_encryption_file_key(no_encrypt_metadata : Bool, password : BytesView, revision : Int, owner_entry : BytesView, permissions : Int, file_id : BytesView, key_length_bits : Int) -> Bytesfn pdf_encryption_object_key(crypt_type : PdfCryptType, object_number : Int, generation : Int, file_key : BytesView, key_length_bits : Int) -> Bytesfn pdf_is_whitespace_or_delimiter_byte(value : Int) -> Boolfn pdf_make_owner_password_entry(revision : Int, owner_password : BytesView, user_password : BytesView, key_length_bits : Int) -> Bytes raise PdfErrorfn pdf_make_user_password_entry(no_encrypt_metadata : Bool, user_password : BytesView, revision : Int, owner_entry : BytesView, permissions : Int, file_id : BytesView, key_length_bits : Int) -> Bytes raise PdfErrorfn 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_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_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_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_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_standard14_text_width(font : PdfStandardFont, encoding : PdfEncoding, text : BytesView, kern? : Bool) -> Intfn pdf_user_password_from_owner_password(revision : Int, owner_password : BytesView, owner_entry : BytesView, key_length_bits : Int) -> Bytes 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_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 transform_append(after : ArrayView[TransformOp], before : ArrayView[TransformOp]) -> Array[TransformOp]