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 interpret;
37mod soft_mask;
38mod types;
39mod x_object;
40
41pub mod color;
42pub mod encode;
43pub mod font;
44pub mod pattern;
45pub mod shading;
46pub mod util;
47
48pub use cache::CacheKey;
49pub use context::*;
50pub use device::*;
51pub use hayro_syntax;
52pub use hayro_syntax::Pdf;
53pub use interpret::*;
54pub use soft_mask::*;
55pub use types::*;