hayro-interpret

Crates.iohayro-interpret
lib.rshayro-interpret
version0.3.0
created_at2025-07-22 16:32:41.766908+00
updated_at2025-09-09 12:41:52.085596+00
descriptionA crate for interpreting PDF files.
homepage
repositoryhttps://github.com/LaurenzV/hayro
max_upload_size
id1763717
size857,099
Laurenz Stampfl (LaurenzV)

documentation

README

hayro-interpret

Crates.io Documentation

A crate for interpreting PDF files.

This crate provides an abstraction to interpret the content of a PDF file and render them into an abstract [Device], which clients can implement as needed. This allows you, for example, to render PDF files to bitmaps (which is what the hayro crate does), or other formats such as SVG.

It should be noted that this crate is still very much in development. Therefore it currently lacks pretty much any documentation on how to use it. It's current API also only really makes it useful for rendering to PNG or SVG, though this will be improved upon in the future.

Examples

See the examples folder on the GitHub repository. Apart from that, you can also consult the implementation of hayro and hayro-svg to get an idea on how to use this crate.

Safety

This crate forbids unsafe code via a crate-level attribute.

Cargo features

This crate has two optional features:

  • jpeg2000: See the description of hayro-syntax for more information.
  • embed-fonts: PDF processors are required to support 14 predefined fonts that do not need to be embedded into a PDF file. If you enable this feature, hayro will embed a (permissively-licensed) substitute for each font, so that you don't have to implement your custom font loading logic. This will add around ~240KB to your binary.

License

This crate is available under the Apache 2.0 license.

Commit count: 768

cargo fmt