package cpdf
Install
Dune Dependency
Authors
Maintainers
Sources
md5=45ba51aae6b5d3ea6cb421037f8f73bb
sha512=f325c703835a82be462cafa5fb9548329ef648e3aa66bca73c2ae1d9e99813b3008915018bf5090e0c0dd6e31509e97895b01c64a9b4484c4993be59e85995e8
doc/cpdf/Cpdfmetadata/index.html
Module Cpdfmetadata
Metadata
Types and Exceptions
Possible output encodings for some function. Raw
does no processing at all - the PDF string is output as-is. UTF8
converts loslessly to UTF8. Stripped
extracts the unicode codepoints and returns only those which correspond to 7 bit ASCII.
val encode_output : encoding -> string -> string
Encode a string using a given encoding.
Metadata and settings
copy_id keepversion copyfrom copyto
copies the ID, if any, from copyfrom
to copyto
. If keepversion
is true, the PDF version of copyto
won't be affected.
val set_pdf_info :
?xmp_also:bool ->
?xmp_just_set:bool ->
(string * Pdf.pdfobject * int) ->
Pdf.t ->
Pdf.t
set_pdf_info (key, value, version)
sets the entry key
in the /Info directory, updating the PDF minor version to version
.
val get_xmp_info : Pdf.t -> string -> string
Get XMP information for a given key.
val set_viewer_preference : (string * Pdf.pdfobject * int) -> Pdf.t -> Pdf.t
set_pdf_info (key, value, version)
sets the entry key
in the /ViewerPreferences directory, updating the PDF minor version to version
.
Set the page layout to the given name (sans slash) e.g SinglePage
Set the page mode to the given name (sans slash) e.g UseThumbs
Set the non full screen page mode to the given name (sans slash) e.g UseThumbs
Set the open action. If the boolean is true, /Fit will be used, otherwise /XYZ
val set_version : int -> Pdf.t -> unit
Set the PDF version number
val get_info_utf8 : Pdf.t -> string -> string
Given a PDF, returns a function which can lookup a given dictionary entry from the /Info dictionary, returning it as a UTF8 string
val output_info :
?json:(string * Cpdfyojson.Safe.t) list ref ->
encoding ->
Pdfunits.t ->
Pdf.t ->
unit
Output to standard output general information about a PDF.
val output_xmp_info :
?json:(string * Cpdfyojson.Safe.t) list ref ->
encoding ->
Pdfunits.t ->
Pdf.t ->
unit
Output to standard output information from any XMP metadata stream in a PDF.
XML Metadata
set_metadata keepversion filename pdf
sets the XML metadata of a PDF to the contents of filename
. If keepversion
is true, the PDF version will not be altered.
val set_metadata_from_bytes : bool -> Pdfio.bytes -> Pdf.t -> Pdf.t
The same, but the content comes from bytes
.
val get_metadata : Pdf.t -> Pdfio.bytes option
Extract metadata to a Pdfio.bytes
val print_metadata : Pdf.t -> unit
Print metadate to stdout