mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-14 06:22:24 +00:00
* Add craft-stream-codecs: the codec modules of PdfCraft's stream filters LZW, ASCII85, ASCIIHex, RunLength, the TIFF and PNG predictors, bounded CCITT fax decoding (through hayro-ccitt) with Group 4 encoding (through fax), and the lossless JBIG2 encoder with its MQ coder, from pdfcraft-filters at PdfCraft revision 80e26e674d1aa33078e83c8139875047f3289eb6. The crate sits below craft-pdf and craft-tiff: it knows no container. The PDF filter chain, Flate and the bounded JBIG2 decoding entry are not part of it. * craft-pdf: the PDF filter chain from PdfCraft (`filters`) Adds the `filters` feature: the /Filter chain of pdfcraft-filters (PdfCraft revision 80e26e674d1aa33078e83c8139875047f3289eb6) as craft_pdf::filters, over the codecs in craft-stream-codecs. It adds Flate, strict and tolerant chain decoding, byte accounting and a shared work allowance, and encoding, with the chain's unit tests, its property tests and its fuzz target. The code is unchanged apart from the imports of the moved codecs; FilterError is craft-stream-codecs' CodecError under its old name.
53 lines
1.9 KiB
TOML
53 lines
1.9 KiB
TOML
[package]
|
|
name = "craft-pdf"
|
|
description = "Shared PDF reading, rendering and optional writing for Craft apps"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = []
|
|
read = ["dep:hayro-syntax", "dep:thiserror"]
|
|
interpret = ["read", "dep:hayro-interpret"]
|
|
raster = ["interpret", "dep:hayro", "dep:bytemuck"]
|
|
write = ["dep:krilla", "dep:thiserror"]
|
|
write-pdf = ["write", "krilla/pdf"]
|
|
write-simple-text = ["write", "krilla/simple-text"]
|
|
filters = ["dep:craft-stream-codecs", "dep:flate2", "dep:thiserror"]
|
|
crypt = ["dep:aes", "dep:md-5", "dep:sha2", "dep:stringprep", "dep:zeroize", "dep:thiserror"]
|
|
|
|
[dependencies]
|
|
hayro-syntax = { workspace = true, optional = true }
|
|
hayro-interpret = { workspace = true, optional = true }
|
|
hayro = { workspace = true, optional = true }
|
|
bytemuck = { workspace = true, optional = true }
|
|
krilla = { workspace = true, optional = true }
|
|
thiserror = { workspace = true, optional = true }
|
|
# The filter chain (`filters`). flate2 with zlib-rs, the backend the chain's Flate prices were measured on.
|
|
craft-stream-codecs = { workspace = true, optional = true }
|
|
flate2 = { version = "1.1", default-features = false, features = ["zlib-rs"], optional = true }
|
|
# The standard security handler (`crypt`): pure Rust, MIT OR Apache-2.0, builds for wasm.
|
|
aes = { version = "0.9", optional = true }
|
|
md-5 = { version = "0.11", optional = true }
|
|
sha2 = { version = "0.11", optional = true }
|
|
stringprep = { version = "0.1", optional = true }
|
|
zeroize = { version = "1", optional = true }
|
|
|
|
[dev-dependencies]
|
|
hayro-syntax = "=0.7.2"
|
|
hayro-interpret = { version = "=0.7.0", default-features = false }
|
|
hayro-cmap = "=0.1.0"
|
|
kurbo = "0.13"
|
|
ttf-parser = "=0.25.1"
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
|
|
proptest = { workspace = true }
|
|
|
|
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
|
|
wasm-bindgen-test = "0.3"
|