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 one optional feature:
22- `embed-fonts`: PDF processors are required to support 14 predefined fonts that do not need to be
23 embedded into a PDF file. If you enable this feature, hayro will embed a (permissively-licensed)
24 substitute for each font, so that you don't have to implement your custom font loading logic. This
25 will add around ~240KB to your binary.
26*/
27
28#![forbid(unsafe_code)]
29#![deny(missing_docs)]
30
31mod cache;
32mod context;
33mod convert;
34mod device;
35mod function;
36mod interpret;
37mod ocg;
38mod soft_mask;
39mod types;
40mod x_object;
41
42pub mod color;
43pub mod encode;
44pub mod font;
45pub mod pattern;
46pub mod shading;
47pub mod util;
48
49pub use cache::CacheKey;
50pub use context::*;
51pub use device::*;
52pub use function::Function;
53pub use hayro_syntax;
54pub use interpret::*;
55pub use soft_mask::*;
56pub use types::*;
57pub use util::{PageExt, RectExt};