6 releases (3 breaking)
| 0.4.1 | Oct 29, 2025 |
|---|---|
| 0.4.0 |
|
| 0.3.1 | Oct 8, 2025 |
| 0.2.3 | Oct 11, 2024 |
| 0.1.0 | Jun 15, 2023 |
#601 in FFI
60KB
1.5K
SLoC
Contains (JAR file, 44KB) bundle/gradle/wrapper/gradle-wrapper.jar
iText-rs
Rust bindings to the iText 7.1.18 library.
Bindings
This library provides (partial) bindings for the following iText classes:
- com.itextpdf.io
- ImageData
- com.itextpdf.kernel
- PdfDocument
- PdfWriter
- SolidLine
- PageSize
- ColorConstant
- com.itextpdf.layout
- Document
- Table
- Cell
- Paragraph
- LineSeparator
- Image
To support the iText-PDF types, there are also some other bindings included:
- java.io.ByteArrayOutputStream
- java.io.ByteArrayInputStream
- java.awt.image.BufferedImage
- javax.imageio.ImageIO
- javax.imageio.stream.ImageInputStream
PR's to add missing bindings or to add to incomplete bindings are more than welcome.
The library
To function, this crate needs a JVM, obviously. Furthermore it needs the iText kernel, layout and io libraries.
These are included in this crate via the bundled feature. A JAR file containing all dependencies is then included
at itext::bundle::DEPENDENCIES;
If you're using the invocation API of the JVM to start it from code, add the option -Djava.class.path=<PATH TO JARFILE>
to the JVM's start options. Of course, the dependencies jarfile must be saved to disk for this to work.
License
This library is provided under the MIT or Apache 2.0 license, at your option.
itext-rs
Rust bindings to the Java library iText-PDF version 9.2.
Purpose
Generating PDFs in Rust is at the early stages. Java's PDF world is pretty far along. This library allows a Rust program to create PDFs using iText PDF.
Compiling
If the bundled feature is enabled:
- The JVM should be installed.
- The environmental variable
JAVA_HOMEshould be set.
Usage
If the bundled feature is enabled:
When using JNI's invocation API, the JAR file embedded in this crate
should be added to the classpath:
- Save the jarfile (const
bundle::DEPENDENCIES) to disk - Add the option
-Djava.class.path=<PATH TO JARFILE>to the JVM's start parameters.
If the bundled feature is not enabled, you are responsible for providing the itext-pdf libraries to the JVM.
License
MIT or Apache-2.0, at your option.
Dependencies
~2–13MB
~94K SLoC