cpdf-source/cpdfjson.mli

21 lines
1.2 KiB
OCaml
Raw Normal View History

2022-01-13 14:43:23 +01:00
(** Read and write PDFs in CPDFJSON format *)
(** Write a PDF in CPDFJSON format. [parse_content] parses page content
streams, [no_stream_data] will omit stream data, [decompress_streams]
decompresses all streams, [clean_strings] will convert any UTF16BE strings
2023-07-27 14:21:15 +02:00
to PDFDocEncoding if it can. If [utf8] is set, CPDFJSON UTF8 format is used
instead. *)
2023-01-16 08:03:34 +01:00
val to_output : Pdfio.output -> utf8:bool -> parse_content:bool -> no_stream_data:bool -> decompress_streams:bool -> ?clean_strings:bool -> Pdf.t -> unit
2022-01-13 14:43:23 +01:00
(** Read a CPDFJSON PDF from an input. /Length entries will be corrected automatically. *)
2021-10-01 13:16:55 +02:00
val of_input : Pdfio.input -> Pdf.t
2022-01-13 14:43:23 +01:00
2023-07-27 14:21:15 +02:00
(** Convert a single PDF object to CPDFJSON format. [clean_strings] and [utf8] are as above.
2022-01-13 14:43:23 +01:00
Then the PDF file, then a function which is usually [function _ -> ()], then
[no_stream_data] as above, then [parse_content_streams] as above, and
finally the object itself. *)
2023-01-16 08:03:34 +01:00
val json_of_object : utf8:bool -> ?clean_strings:bool -> Pdf.t -> (int -> unit) -> no_stream_data:bool -> parse_content:bool -> Pdf.pdfobject -> Cpdfyojson.Safe.t
2022-01-13 14:43:23 +01:00
(** Convert a single CPDFJSON object to a PDF object *)
2023-02-17 16:30:39 +01:00
val object_of_json : Cpdfyojson.Safe.t -> Pdf.pdfobject