Module wkhtmltopdf::image [−][src]
Generate images from HTML safely using wkhtmltopdf
Wkhtmltoimage uses QT Webkit to render HTML for image generation. This crate depends on low-level wkhtmltoimage bindings, to provide an ergonomic API for generating images from URLs, local HTML files, or HTML strings. Installing wkhtmltoimage (currently 0.12.6) is a prerequisite to using this crate.
Example
use wkhtmltopdf::*; let image_app = ImageApplication::new().expect("Failed to init image application"); let mut imageout = image_app.builder() .format(ImageFormat::Png) .build_from_path("input.html") .expect("failed to build image"); imageout.save("foo.png").expect("failed to save foo.png");
Other examples can be seen in the documentation for
ImageBuilder
methods:
Addtionally, the lowlevel
module provides safe abstractions
that allow full configuration of wkhtmltoimage.
Modules
lowlevel | Low-level wkhtmltoimage without the raw pointers |
Structs
ImageApplication | Structure for initializing the underlying wkhtmltoimage |
ImageBuilder | High-level builder for generating images (initialized from |
ImageOutput | Generated image output |
Enums
ImageFormat | Image formats supported by wkhtmltoimage |