Convert HTML to pdf library Rust
This repository contains the htmltopdf Rust library, which converts HTML to PDF. Below are instructions for integrating and using this library in different environments.
Prerequisites
- Rust installed on your system
- Java Development Kit (JDK) installed
- Maven installed
Building the Rust Library
-
Clone the Repository
Clone the repository containing the
html_to_pdf_lib
Rust library.
Build the Rust Library
Build the Rust library to generate the shared library file (.so, .dll, or .dylib) for JNI.
```sh
cargo build --release
cargo run file.html
The shared library will be located in the target/release directory. The filename will be html_to_pdf_lib..
Usage Rust project
To use html_to_pdf_lib
in your Rust project, follow these steps:
-
Add the library as a dependency in your
Cargo.toml
:[] = "0.1.0"
-
Use the library in your Rust code:
use convert_html_to_pdf;
License
This project is licensed under the MIT License - see the LICENSE file for details.