Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
PyPDF2
A pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
So I used this fork instead: https://github.com/dabega/genpdf-rs and specified as a git path in my cargo.toml (after forking it myself to freeze to the current commit)
The API seems to be very close to the official 0.2.0 version, so the docs on docs.rs worked for me.
If you are looking to generate PDFs, I recommend "genpdf". However, the version from the primary author on crates.io seems to have some very strange character spacing: https://genpdf-rs.ireas.org/examples/demo.pdf
The only “sane” way I’ve found to be able to deal with pdfs is through this tool https://wkhtmltopdf.org/
As other posters have said, if you're just generating PDFs, that's doable with minor library support. If you want to open existing PDFs and do anything non-trivial with them, you'll want a mature, powerful PDF parsing library. PDFKit, which is part of macOS is pretty amazing. If you need portability, something like Python's PyPDF2 is probably the best bet. Knowing the Rust community, though, we'll probably get a library at least as good in Rust in a surprisingly short amount of time.