hayro_interpret/lib.rs
1/*!
2A crate for interpreting PDF files.
3
4This crate provides an abstraction to interpret the content of a PDF file and render them
5into an abstract [`Device`], which clients can implement as needed. This allows you, for
6example, to render PDF files to bitmaps (which is what the `hayro` crate does), or other formats
7such as SVG.
8
9It should be noted that this crate is still very much in development. Therefore it currently
10lacks pretty much any documentation on how to use it. It's current API also only really makes it
11useful for rendering to PNG or SVG, though this will be improved upon in the future.
12
13# Examples
14See the `examples` folder on the GitHub repository. Apart from that, you can also consult
15the implementation of `hayro` and `hayro-svg` to get an idea on how to use this crate.
16
17# Safety
18This crate forbids unsafe code via a crate-level attribute.
19
20# Cargo features
21This crate has two optional features:
22- `jpeg2000`: See the description of [`hayro-syntax`](https://docs.rs/hayro-syntax/latest/hayro_syntax/#cargo-features) for more information.
23- `embed-fonts`: PDF processors are required to support 14 predefined fonts that do not need to be
24 embedded into a PDF file. If you enable this feature, hayro will embed a (permissively-licensed)
25 substitute for each font, so that you don't have to implement your custom font loading logic. This
26 will add around ~240KB to your binary.
27*/
28
29#![forbid(unsafe_code)]
30#![deny(missing_docs)]
31
32mod cache;
33mod context;
34mod convert;
35mod device;
36mod function;
37mod interpret;
38mod ocg;
39mod soft_mask;
40mod types;
41mod x_object;
42
43pub mod color;
44pub mod encode;
45pub mod font;
46pub mod pattern;
47pub mod shading;
48pub mod util;
49
50pub use cache::CacheKey;
51pub use context::*;
52pub use device::*;
53pub use hayro_syntax;
54pub use hayro_syntax::Pdf;
55pub use interpret::*;
56pub use soft_mask::*;
57pub use types::*;