mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 17:02:03 -06:00
Opening a .ai or a PDF read and checked the whole file up to five times: for the document it carries, for whether it holds the editor's private data, for the import, for the editor's copy and for its File Info. Each pass parses the file and walks every object, about 190 ms on a 15 MB .ai. - vectorcraft_pdf::open_pdf reads and checks the file once, on the import's deep-stack thread, and import_opened imports pages from that reading. document.open takes the carried document, the page count, the editor's copy and the File Info from it. The editor's copy is read after the page import and only when the file is not restored from a carried document; so is the File Info. - A .ai saved without PDF compatibility opened with pages that name every page reads its editor's copy from the same reading. - document.pdfInfo reads the file once for its pages and the thumbnail. - The Open and Place dialogs read the file once to decide whether to ask for pages, instead of twice. A file whose PDF part fails the check still reads its editing data separately, as before.
55 lines
1.8 KiB
TOML
55 lines
1.8 KiB
TOML
[package]
|
|
name = "vectorcraft-pdf"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "VectorCraft PDF export and import"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
# `vectorcraft_pdf::reads_of` for other crates' tests (dev-dependencies only).
|
|
read-count = []
|
|
|
|
[dependencies]
|
|
vectorcraft-geom = { workspace = true }
|
|
vectorcraft-doc = { workspace = true }
|
|
vectorcraft-effects = { workspace = true }
|
|
vectorcraft-brush = { workspace = true }
|
|
vectorcraft-color = { workspace = true }
|
|
vectorcraft-text = { workspace = true }
|
|
skrifa = { workspace = true }
|
|
kurbo = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
flate2 = { workspace = true, features = ["zlib-rs"] }
|
|
image = { workspace = true }
|
|
# CMYK JPEGs (the image crate writes RGB and grey ones only).
|
|
jpeg-encoder = { workspace = true }
|
|
craft-pdf = { workspace = true }
|
|
log = { workspace = true }
|
|
chrono = { workspace = true }
|
|
smallvec = "1"
|
|
weezl = "0.2"
|
|
serde = { workspace = true }
|
|
# The XMP packet that File Info is read from (file_info.rs); the version usvg already uses.
|
|
roxmltree = "0.21"
|
|
# PDF security (encrypt.rs): pure Rust, MIT OR Apache-2.0, builds for wasm.
|
|
aes = "0.8"
|
|
md-5 = { version = "0.10", default-features = false }
|
|
sha2 = { version = "0.10", default-features = false }
|
|
# The seed of the file key, salts and IVs (encrypt.rs).
|
|
getrandom = "0.4"
|
|
|
|
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
|
|
# The browser's crypto.getRandomValues.
|
|
getrandom = { version = "0.4", features = ["wasm_js"] }
|
|
|
|
[dev-dependencies]
|
|
vectorcraft-testkit = { workspace = true }
|
|
# A variable font built in code (no font file is committed).
|
|
vectorcraft-text = { workspace = true, features = ["test-fonts"] }
|
|
serde_json = { workspace = true }
|
|
# `draw_text`, to write test files with live text as other writers do.
|
|
krilla = { workspace = true, features = ["simple-text"] }
|