package cpdf

  1. Overview
  2. Docs
val demo : bool
val noncomp : bool
val major_version : int
val minor_version : int
val version_date : string
val tempfiles : string list ref
val exit : int -> 'a
val initial_file_size : int ref
val empty : Pdf.t
val emptypage : Pdfpage.t
val pdfread_pdf_of_input : ?revision:int -> string option -> string option -> Pdfio.input -> Pdf.t
val pdfread_pdf_of_channel_lazy : ?revision:int -> ?source:string -> string option -> string option -> in_channel -> Pdf.t
val pdfread_pdf_of_file : ?revision:int -> string option -> string option -> string -> Pdf.t
val optstring : string -> string option
val stay_on_error : bool ref
exception StayOnError
val error : string -> 'a
val soft_error : string -> 'a
val parse_pagespec : Pdf.t -> string -> int list
type op =
  1. | CopyFont of string
  2. | CSP1
  3. | CSP2 of float
  4. | CSP3
  5. | CountPages
  6. | Version
  7. | Encrypt
  8. | Decrypt
  9. | StampOn of string
  10. | StampUnder of string
  11. | CombinePages of string
  12. | TwoUp
  13. | TwoUpStack
  14. | RemoveBookmarks
  15. | AddBookmarks of string
  16. | AddText of string
  17. | AddRectangle
  18. | RemoveText
  19. | Draft
  20. | PadBefore
  21. | PadAfter
  22. | PadEvery of int
  23. | PadMultiple of int
  24. | PadMultipleBefore of int
  25. | Shift
  26. | Scale
  27. | ScaleToFit
  28. | ScaleContents of float
  29. | AttachFile of string list
  30. | RemoveAttachedFiles
  31. | ListAttachedFiles
  32. | DumpAttachedFiles
  33. | RemoveAnnotations
  34. | ListAnnotations
  35. | ListAnnotationsMore
  36. | CopyAnnotations of string
  37. | Merge
  38. | Split
  39. | SplitOnBookmarks of int
  40. | Clean
  41. | Info
  42. | PageInfo
  43. | Metadata
  44. | SetMetadata of string
  45. | RemoveMetadata
  46. | Fonts
  47. | RemoveFonts
  48. | Compress
  49. | Decompress
  50. | Crop
  51. | Trim
  52. | Bleed
  53. | Art
  54. | RemoveCrop
  55. | RemoveArt
  56. | RemoveTrim
  57. | RemoveBleed
  58. | CopyCropBoxToMediaBox
  59. | CopyBox
  60. | MediaBox
  61. | HardBox of string
  62. | Rotate of int
  63. | Rotateby of int
  64. | RotateContents of float
  65. | Upright
  66. | VFlip
  67. | HFlip
  68. | ThinLines of float
  69. | SetAuthor of string
  70. | SetTitle of string
  71. | SetSubject of string
  72. | SetKeywords of string
  73. | SetCreate of string
  74. | SetModify of string
  75. | SetCreator of string
  76. | SetProducer of string
  77. | SetTrapped
  78. | SetUntrapped
  79. | SetVersion of int
  80. | ListBookmarks
  81. | SetPageLayout of string
  82. | SetPageMode of string
  83. | HideToolbar of bool
  84. | HideMenubar of bool
  85. | HideWindowUI of bool
  86. | FitWindow of bool
  87. | CenterWindow of bool
  88. | DisplayDocTitle of bool
  89. | Presentation
  90. | ChangeId
  91. | RemoveId
  92. | CopyId of string
  93. | BlackText
  94. | BlackLines
  95. | BlackFills
  96. | ExtractImages
  97. | ImageResolution of float
  98. | MissingFonts
  99. | RemoveUnusedResources
  100. | ExtractFontFile
  101. | ExtractText
  102. | OpenAtPage of int
  103. | OpenAtPageFit of int
  104. | AddPageLabels
  105. | RemovePageLabels
  106. | PrintPageLabels
  107. | Revisions
  108. | RemoveDictEntry of string
  109. | ListSpotColours
  110. | RemoveClipping
  111. | SetMetadataDate of string
  112. | CreateMetadata
  113. | EmbedMissingFonts
  114. | BookmarksOpenToLevel of int
  115. | CreatePDF
  116. | RemoveAllText
  117. | ShowBoxes
  118. | TrimMarks
val string_of_op : op -> string
type input_kind =
  1. | AlreadyInMemory of Pdf.t
  2. | InFile of string
  3. | StdIn
val string_of_input_kind : input_kind -> string
type input = input_kind * string * string * string * bool ref * int option
type output_method =
  1. | NoOutputSpecified
  2. | Stdout
  3. | File of string
val output_pdfs : Pdf.t list ref
type font =
  1. | StandardFont of Pdftext.standard_font
  2. | OtherFont of string
type args = {
  1. mutable op : op option;
  2. mutable preserve_objstm : bool;
  3. mutable create_objstm : bool;
  4. mutable out : output_method;
  5. mutable inputs : input list;
  6. mutable chunksize : int;
  7. mutable linearize : bool;
  8. mutable keeplinearize : bool;
  9. mutable rectangle : string;
  10. mutable coord : string;
  11. mutable duration : float option;
  12. mutable transition : string option;
  13. mutable horizontal : bool;
  14. mutable inward : bool;
  15. mutable direction : int;
  16. mutable effect_duration : float;
  17. mutable font : font;
  18. mutable fontname : string;
  19. mutable fontsize : float;
  20. mutable color : float * float * float;
  21. mutable opacity : float;
  22. mutable position : Cpdf.position;
  23. mutable underneath : bool;
  24. mutable linespacing : float;
  25. mutable midline : bool;
  26. mutable topline : bool;
  27. mutable justification : Cpdf.justification;
  28. mutable bates : int;
  29. mutable batespad : int option;
  30. mutable prerotate : bool;
  31. mutable orientation : Cpdf.orientation;
  32. mutable relative_to_cropbox : bool;
  33. mutable keepversion : bool;
  34. mutable bycolumns : bool;
  35. mutable pagerotation : int;
  36. mutable crypt_method : string;
  37. mutable owner : string;
  38. mutable user : string;
  39. mutable no_edit : bool;
  40. mutable no_print : bool;
  41. mutable no_copy : bool;
  42. mutable no_annot : bool;
  43. mutable no_forms : bool;
  44. mutable no_extract : bool;
  45. mutable no_assemble : bool;
  46. mutable no_hq_print : bool;
  47. mutable debug : bool;
  48. mutable debugcrypt : bool;
  49. mutable debugforce : bool;
  50. mutable boxes : bool;
  51. mutable encrypt_metadata : bool;
  52. mutable retain_numbering : bool;
  53. mutable remove_duplicate_fonts : bool;
  54. mutable remove_duplicate_streams : bool;
  55. mutable encoding : Cpdf.encoding;
  56. mutable scale : float;
  57. mutable copyfontpage : int;
  58. mutable copyfontname : string option;
  59. mutable fast : bool;
  60. mutable dashrange : string;
  61. mutable outline : bool;
  62. mutable linewidth : float;
  63. mutable path_to_ghostscript : string;
  64. mutable frombox : string option;
  65. mutable tobox : string option;
  66. mutable mediabox_if_missing : bool;
  67. mutable topage : string option;
  68. mutable scale_stamp_to_fit : bool;
  69. mutable keep_this_id : string option;
  70. mutable makenewid : bool;
  71. mutable labelstyle : Pdfpagelabels.labelstyle;
  72. mutable labelprefix : string option;
  73. mutable labelstartval : int;
  74. mutable squeeze : bool;
  75. mutable original_filename : string;
  76. mutable was_encrypted : bool;
  77. mutable cpdflin : string option;
  78. mutable recrypt : bool;
  79. mutable was_decrypted_with_owner : bool;
  80. mutable creator : string option;
  81. mutable producer : string option;
  82. mutable embedfonts : bool;
  83. mutable extract_text_font_size : float option;
  84. mutable padwith : string option;
  85. mutable alsosetxml : bool;
  86. mutable justsetxml : bool;
  87. mutable gs_malformed : bool;
  88. mutable gs_quiet : bool;
  89. mutable merge_add_bookmarks : bool;
  90. mutable merge_add_bookmarks_use_titles : bool;
  91. mutable createpdf_pages : int;
  92. mutable createpdf_pagesize : Pdfpaper.t;
  93. mutable removeonly : string option;
}
val args : args
val reset_arguments : unit -> unit
val get_pagespec : unit -> string
val string_of_permission : Pdfcrypt.permission -> string
val getpermissions : Pdf.t -> string
val banlist_of_args : unit -> Pdfcrypt.permission list
val banned : Pdfcrypt.permission list -> op -> bool
val operation_allowed : Pdf.t -> Pdfcrypt.permission list -> op option -> bool
val decrypt_if_necessary : ('a * 'b * string * string * bool ref * 'c) -> op option -> Pdf.t -> Pdf.t
val nobble : Pdf.t -> Pdf.t
val output_page_count : Pdf.t -> unit
val detect_duplicate_op : op -> unit
val setop : op -> unit -> unit
val setout : string -> unit
val setchunk : int -> unit
val setlinearize : unit -> unit
val setkeeplinearize : unit -> unit
val fixdashes : string -> string
val encrypt_to_collect : int ref
val setmethod : string -> unit
val setowner : string -> unit
val setuser : string -> unit
val anon_fun : string -> unit
val mm : float -> float
val cm : float -> float
val inch : float -> float
val points_of_papersize : Pdfpaper.t -> float * float
val cropbox : Pdf.t -> Pdfpage.t -> Pdf.pdfobject
val width : Pdf.pdfobject -> float
val height : Pdf.pdfobject -> float
val minx : Pdf.pdfobject -> float
val miny : Pdf.pdfobject -> float
val maxx : Pdf.pdfobject -> float
val maxy : Pdf.pdfobject -> float
val find_page_width : 'a -> Pdfpage.t -> float
val find_page_height : 'a -> Pdfpage.t -> float
val find_page_crop_width : Pdf.t -> Pdfpage.t -> float
val find_page_crop_height : Pdf.t -> Pdfpage.t -> float
val find_page_minx : 'a -> Pdfpage.t -> float
val find_page_miny : 'a -> Pdfpage.t -> float
val find_page_maxx : 'a -> Pdfpage.t -> float
val find_page_maxy : 'a -> Pdfpage.t -> float
val find_page_crop_minx : Pdf.t -> Pdfpage.t -> float
val find_page_crop_miny : Pdf.t -> Pdfpage.t -> float
val find_page_crop_maxx : Pdf.t -> Pdfpage.t -> float
val find_page_crop_maxy : Pdf.t -> Pdfpage.t -> float
val find_page_characteristic : Pdf.t -> Pdfpage.t -> Pdfgenlex.t -> float
val make_num : Pdf.t -> Pdfpage.t -> Pdfgenlex.t -> Pdfgenlex.t -> float
val update_last_number : Pdf.t -> Pdfpage.t -> Pdfgenlex.t -> Pdfgenlex.t -> Pdfgenlex.t -> float list -> float list
val parse_units_again : Pdf.t -> Pdfpage.t -> float list -> Pdfpaper.t -> Pdfgenlex.t list -> float list
val parse_units : Pdf.t -> Pdfpage.t -> float list -> Pdfgenlex.t list -> float list
val space_units_inner : char list -> char list
val space_units : string -> string
val parse_units_string : Pdf.t -> Pdfpage.t -> string -> float list
val parse_rectangle : Pdf.t -> string -> float * float * float * float
val parse_rectangles : Pdf.t -> string -> (float * float * float * float) list
val parse_coordinate : Pdf.t -> string -> float * float
val parse_coordinates : Pdf.t -> string -> (float * float) list
val parse_single_number : Pdf.t -> string -> float
val setcrop : string -> unit
val settrim : string -> unit
val setbleed : string -> unit
val setart : string -> unit
val setmediabox : string -> unit
val setrectangle : string -> unit
val setrotate : int -> unit
val setrotateby : int -> unit
val setrotatecontents : float -> unit
val setauthor : string -> unit
val settitle : string -> unit
val setsubject : string -> unit
val setkeywords : string -> unit
val setcreate : string -> unit
val setmodify : string -> unit
val setmetadata : string -> unit
val setversion : int -> unit
val setpagelayout : string -> unit
val setpagemode : string -> unit
val hidetoolbar : string -> unit
val hidemenubar : string -> unit
val hidewindowui : string -> unit
val fitwindow : string -> unit
val centerwindow : string -> unit
val displaydoctitle : string -> unit
val setsplitbookmarks : int -> unit
val setstdout : unit -> unit
val setstdin : unit -> unit
val settrans : string -> unit
val setduration : float -> unit
val setvertical : unit -> unit
val setoutward : unit -> unit
val setdirection : int -> unit
val seteffectduration : float -> unit
val setcopyid : string -> unit
val setthinlines : string -> unit
val setcopyannotations : string -> unit
val setshift : string -> unit
val setscale : string -> unit
val setscaletofit : string -> unit
val setattachfile : string -> unit
val setfont : string -> unit
val setextracttextfontsize : float -> unit
val setfontsize : float -> unit
val setaddtext : string -> unit
val parse_color : string -> float * float * float
val setcolor : string -> unit
val setopacity : float -> unit
val setaddbookmarks : string -> unit
val setstampon : string -> unit
val setstampunder : string -> unit
val setcombinepages : string -> unit
val setposcenter : string -> unit
val setposleft : string -> unit
val setposright : string -> unit
val settop : string -> unit
val settopleft : string -> unit
val settopright : string -> unit
val setleft : string -> unit
val setbottomleft : string -> unit
val setbottom : string -> unit
val setbottomright : string -> unit
val setright : string -> unit
val setdiagonal : 'a -> unit
val setreversediagonal : 'a -> unit
val setcenter : 'a -> unit
val setscalecenter : 'a -> unit
val setbatespad : int -> unit
val setbates : int -> unit
val setbatesrange : int -> unit
val setkeepversion : unit -> unit
val setbycolumns : unit -> unit
val setpagerotation : int -> unit
val set_no_edit : unit -> unit
val set_no_print : unit -> unit
val set_no_copy : unit -> unit
val set_no_annot : unit -> unit
val set_no_forms : unit -> unit
val set_no_extract : unit -> unit
val set_no_assemble : unit -> unit
val set_no_hq_print : unit -> unit
val set_input : string -> unit
val set_input_dir : string -> unit
val setdebug : unit -> unit
val setdebugcrypt : unit -> unit
val setdebugforce : unit -> unit
val setboxes : unit -> unit
val set_no_encrypt_metadata : unit -> unit
val set_retain_numbering : unit -> unit
val set_remove_duplicate_fonts : unit -> unit
val setencoding : Cpdf.encoding -> unit -> unit
val setlinespacing : float -> unit
val setmidline : unit -> unit
val settopline : unit -> unit
val setscaletofitscale : float -> unit
val setscalecontents : float -> unit
val setsqueeze : unit -> unit
val setcreator : string -> unit
val setproducer : string -> unit
val getuntilendquote : char list -> char list -> string * char list
val getarg : char list -> char list -> string * char list
val parse_chars : string list -> char list -> string list
val control_args : string list ref
val parse_control_file : string -> string list
val setencryptcollect : unit -> unit
val setcopyfont : string -> unit
val setfontpage : int -> unit
val setcopyfontname : string -> unit
val setpadevery : int -> unit
val setpadwith : string -> unit
val setpadmultiple : int -> unit
val setpadmultiplebefore : int -> unit
val setfast : unit -> unit
val setcsp2 : float -> unit
val setrange : string -> unit
val setrevision : int -> unit
val setoutline : unit -> unit
val setlinewidth : float -> unit
val setunderneath : unit -> unit
val setimageresolution : float -> unit
val setgspath : string -> unit
val settextvertical : unit -> unit
val settextverticaldown : unit -> unit
val setfrombox : string -> unit
val settobox : string -> unit
val setmediaboxifmissing : unit -> unit
val setrelativetocropbox : unit -> unit
val setprerotate : unit -> unit
val setflatkids : unit -> unit
val settopage : string -> unit
val setscalestamptofit : unit -> unit
val setkeepthisid : unit -> unit
val setmakenewid : unit -> unit
val setjustifyleft : unit -> unit
val setjustifyright : unit -> unit
val setjustifycenter : unit -> unit
val setremoveduplicatestreams : unit -> unit
val setnopreserveobjstm : unit -> unit
val setcreateobjstm : unit -> unit
val setstdinuser : string -> unit
val setstdinowner : string -> unit
val setopenatpage : int -> unit
val setopenatpagefit : int -> unit
val setlabelstyle : string -> unit
val setlabelprefix : string -> unit
val setlabelstartval : int -> unit
val setcpdflin : string -> unit
val setrecrypt : unit -> unit
val setremovedictentry : string -> unit
val logto : string option ref
val setsqueezelogto : string -> unit
val setstayonerror : unit -> unit
val setnoembedfont : unit -> unit
val sethardbox : string -> unit
val setalsosetxml : unit -> unit
val setjustsetxml : unit -> unit
val setsetmetadatadate : string -> unit
val setgsmalformed : unit -> unit
val setmergeaddbookmarks : unit -> unit
val setmergeaddbookmarksusetitles : unit -> unit
val setbookmarksopentolevel : int -> unit
val setcreatepdfpages : int -> unit
val setcreatepdfpapersize : string -> unit
val setdraftremoveonly : string -> unit
val setgsquiet : unit -> unit
val whingemalformed : unit -> 'a
val make_control_argv_and_parse : string -> unit
val specs : (string * Arg.spec * string) list
val usage_msg : string
val filesize : string -> int
val embed_missing_fonts : string -> string -> 'a
val mend_pdf_file_with_ghostscript : string -> string
exception StdInBytes of Pdfio.bytes
val pdf_of_stdin : ?revision:int -> string -> string -> Pdf.t
val get_single_pdf : ?decrypt:bool -> ?fail:bool -> op option -> bool -> Pdf.t
val get_single_pdf_nodecrypt : bool -> Pdf.t
val filenames : (string, Pdf.t) Hashtbl.t
val squeeze_logto : string -> string -> unit
val get_pdf_from_input_kind : ?read_lazy:bool -> ?decrypt:bool -> ?fail:bool -> (input_kind * 'a * string * string * bool ref * int option) -> op option -> input_kind -> Pdf.t
val unescape_octals : string -> string
val process : string -> string
val set_producer : string -> Pdf.t -> unit
val set_creator : string -> Pdf.t -> unit
val really_write_pdf : ?encryption:Pdfwrite.encryption option -> ?is_decompress:bool -> bool -> Pdf.t -> string -> unit
val write_pdf : ?encryption:Pdfwrite.encryption option -> ?is_decompress:bool -> bool -> Pdf.t -> unit
val remove_unsafe_characters : string -> string
val get_bookmark_name : Pdf.t -> Pdfmarks.t list -> int -> int -> 'a -> string
val process_others : Pdfmarks.t list -> Pdf.t -> int -> string -> int -> int -> int -> string -> string
val name_of_spec : Pdfmarks.t list -> Pdf.t -> int -> string -> int -> string -> int -> int -> string
val stem : string -> string
val fast_write_split_pdfs : Pdfwrite.encryption option -> int -> string -> bool -> (Pdf.t -> Pdf.t) -> string -> Pdf.t -> int list list -> 'a -> unit
val bookmark_pages : int -> Pdf.t -> int list
val split_at_bookmarks : Pdfwrite.encryption option -> string -> squeeze:bool -> (Pdf.t -> Pdf.t) -> int -> string -> Pdf.t -> unit
val split_pdf : Pdfwrite.encryption option -> string -> int -> 'a -> cpdflin:'b -> preserve_objstm:'c -> create_objstm:'d -> squeeze:bool -> (Pdf.t -> Pdf.t) -> string -> Pdf.t -> unit
val copy_font : Pdf.t -> string -> int -> int list -> Pdf.t -> Pdf.t
val pnm_to_channel_24 : out_channel -> int -> int -> Pdfio.bytes -> unit
val null_device : string
val write_stream : string -> Pdfio.bytes -> unit
val write_image : Pdf.t -> Pdf.pdfobject -> string -> Pdf.pdfobject -> unit
val extract_images : Pdf.t -> int list -> string -> unit
val getencryption : Pdf.t -> string
val copy_cropbox_to_mediabox : Pdf.t -> int list -> Pdf.t
type xobj =
  1. | Image of int * int
  2. | Form of Pdftransform.transform_matrix * Pdf.pdfobject * Pdf.pdfobject
val image_resolution_page : Pdf.t -> Pdfpage.t -> int -> float -> (int * string * xobj) list -> unit
val image_resolution : Pdf.t -> int list -> float -> unit
val is_missing : Pdf.t -> Pdf.pdfobject -> bool
val missing_font : Pdf.t -> int -> (string * Pdf.pdfobject) -> unit
val missing_fonts : Pdf.t -> int list -> unit
val lines_of_channel : in_channel -> string list
val parse_whiteboxes : string -> (float * float * float * float) list
val startends_of_range_inner : (int * int) list -> int list -> (int * int) list
val startends_of_range : int list -> (int * int) list
val calculate_margins : string -> Pdf.t -> int list -> unit
val copy_box : string -> string -> bool -> Pdf.t -> int list -> Pdf.t
val remove_fontdescriptor : Pdf.t -> Pdf.pdfobject -> Pdf.pdfobject
val remove_fonts : Pdf.t -> Pdf.t
val dump_attachment : string -> Pdf.t -> ('a * Pdf.pdfobject) -> unit
val dump_attached_document : Pdf.t -> string -> unit
val dump_attached_page : Pdf.t -> string -> Pdfpage.t -> unit
val dump_attached_files : Pdf.t -> string -> unit
val equalize_pages_extend : Pdf.t -> Pdf.t -> Pdf.t
val remove_unused_resources_page : Pdf.t -> 'a -> Pdfpage.t -> Pdfpage.t
val remove_unused_resources : Pdf.t -> Pdf.t
val extract_fontfile : int -> string -> Pdf.t -> unit
val addrectangle : bool -> (float * float) -> (float * float * float) -> bool -> float -> float -> Cpdf.position -> bool -> bool -> int list -> Pdf.t -> Pdf.t
val print_spot_colour : int -> string -> unit
val list_spot_colours : Pdf.t -> unit
val remove_clipping_ops : Pdf.t -> Pdf.pdfobject -> Pdf.pdfobject list -> Pdf.pdfobject list
val remove_clipping : Pdf.t -> int list -> Pdf.t
val add_bookmark_title : string -> bool -> Pdf.t -> Pdf.t
val bookmarks_open_to_level : int -> Pdf.t -> Pdf.t
val create_pdf : 'a -> 'b -> Pdf.t
val remove_all_text_ops : Pdf.t -> Pdf.pdfobject -> Pdf.pdfobject list -> Pdf.pdfobject list
val remove_all_text_page : Pdf.t -> Pdfpage.t -> Pdfpage.t * Pdf.t
val remove_all_text : int list -> Pdf.t -> Pdf.t
val get_rectangle : Pdf.t -> Pdfpage.t -> string -> (float * float * float * float) option
val show_boxes_page : Pdf.t -> 'a -> Pdfpage.t -> Pdfpage.t
val show_boxes : int list -> Pdf.t -> Pdf.t
val allowance : float
val line : (float * float * float * float) -> Pdfops.t list
val trim_marks_page : Pdf.t -> int -> Pdfpage.t -> Pdfpage.t
val trim_marks : int list -> Pdf.t -> Pdf.t
val parse_argv : unit -> string array -> (Arg.key * Arg.spec * Arg.doc) list -> Arg.anon_fun -> Arg.usage_msg -> unit
val align_specs : (Arg.key * Arg.spec * Arg.doc) list -> (Arg.key * Arg.spec * Arg.doc) list
val expand_args_inner : string list -> string list -> string list
val expand_args : string array -> string array
val gs_malformed_force : string -> string -> 'a
val go_withargv : string array -> unit
val go : unit -> unit
OCaml

Innovation. Community. Security.