2022-01-13 16:18:21 +01:00
|
|
|
(** File Attachments *)
|
|
|
|
|
|
|
|
type attachment =
|
|
|
|
{name : string;
|
|
|
|
pagenumber : int;
|
|
|
|
data : unit -> Pdfio.bytes}
|
|
|
|
|
|
|
|
(** Remove characters which might not make good filenames. If the encoding is
|
|
|
|
[Cpdfmetadata.Stripped] we in addition lose any character > 126. *)
|
2021-12-19 14:38:27 +01:00
|
|
|
val remove_unsafe_characters : Cpdfmetadata.encoding -> string -> string
|
|
|
|
|
2022-01-13 16:18:21 +01:00
|
|
|
(** [attach_file keepversion topage pdf filename] attaches the file in
|
|
|
|
[filename] to the pdf, optionally to a page (rather than document-level).
|
|
|
|
If keepversion is true, the PDF version number won't be altered. *)
|
2021-10-02 13:22:59 +02:00
|
|
|
val attach_file : ?memory:Pdfio.bytes -> bool -> int option -> Pdf.t -> string -> Pdf.t
|
|
|
|
|
|
|
|
(** Remove attached files. *)
|
|
|
|
val remove_attached_files : Pdf.t -> Pdf.t
|
|
|
|
|
|
|
|
(** List attached files. Attachment name and page number. Page 0 is document level. *)
|
|
|
|
val list_attached_files : Pdf.t -> attachment list
|
2021-12-19 14:38:27 +01:00
|
|
|
|
2022-01-13 16:18:21 +01:00
|
|
|
(** Dump attached files to a given directory. *)
|
2021-12-19 14:38:27 +01:00
|
|
|
val dump_attached_files : Pdf.t -> string -> unit
|