Crate pdf2image_alt
source ·Expand description
§Overview
This crate is a modified version of https://github.com/styrowolf/pdf2image with some changes that make it easier and cheaper to render single pages
It requires poppler to be installed on your system. You can follow the instructions found in the README.md file which is most easily viewed on
github.
§Quick Start
use pdf2image_alt::{PDF2ImageError, RenderOptionsBuilder, PdfInfo, render_pdf_multi_page};
fn main() -> Result<(), PDF2ImageError> {
let data = std::fs::read("examples/pdfs/ropes.pdf").unwrap();
let pdf_info = PdfInfo::try_from(data.as_slice()).unwrap();
let options = RenderOptionsBuilder::default().pdftocairo(true).build()?;
let pages = render_pdf_multi_page(&data, &pdf_info, pdf2image_alt::Pages::Range(1..=8), &options);
Ok(())
}Re-exports§
pub use image;
Structs§
- Crop a specific section of the page
- Options for rendering PDFs
- Builder for
RenderOptions.
Enums§
- Specifies resolution in terms of dots per inch
- pdf2img error variants
- Specifies which pages to render
- Password to unlock encrypted PDFs
- Scales pages to a certain number of pixels
Functions§
- Renders the PDF to images.
- Renders the PDF to images.
Type Aliases§
- A
Resulttype alias usingPDF2ImgErrorinstances as the error variant.