Skip to main content

Crate otf_pdf_doc

Crate otf_pdf_doc 

Source
Expand description

Document layer: the page tree, metadata, outlines and attachments on top of the syntax layer’s lazily parsed objects, a copy-on-write overlay for edits, and full and incremental save.

Structs§

Attachment
An embedded file from the /EmbeddedFiles name tree.
AttachmentOptions
Options for Document::add_attachment.
Document
A document opened for reading.
Encryption
Encryption for a full save: always AES-256 (revision 6).
Info
The document information dictionary (§14.3.3), decoded.
OutlineItem
One outline (bookmark) item.
Page
One page, with inherited attributes resolved.
Rect
A rectangle [llx lly urx ury], normalized so llx <= urx and lly <= ury.
SanitizeOptions
What Document::sanitize removes. SanitizeOptions::default removes everything that can run or hide data, and keeps links and metadata.
SanitizeReport
How many items of each kind were removed.
SaveOptions
Options for Document::save.
Store
Base file plus overlay.

Enums§

SaveMode
How to save.

Functions§

decode_text_string
Decodes a text string: UTF-16BE with a BOM, UTF-8 with a BOM (PDF 2.0), otherwise PDFDocEncoding. UTF-16LE with a BOM, which some writers emit, is accepted too. Undecodable units become U+FFFD.
encode_text_string
Encodes a text string: PDFDocEncoding when every character has a byte there, otherwise UTF-16BE with a byte order mark (works in every version).
import
Deep-copies object from src into dst, giving every referenced object a new number in dst. map carries ids already copied (and pre-assigned ones), so shared objects are copied once and cycles end.
name_tree
Every (key, value) pair of a name tree (§7.9.6), in tree order.
pdf_doc_char
One PDFDocEncoding byte (Annex D.2).