Crate scannedpdf

source ·
Expand description

scannedpdf is a simple images to pdf library.

GitHub

An example

let default_config = scannedpdf::PageConfig::new()
    .quality(50)
    .vertical_alignment(scannedpdf::Alignment::Center)
    .margin(scannedpdf::Margin::Custom(20, 20));

let images = vec!["./1.jpg", "2.jpg", "3.jpg"];
let mut file = scannedpdf::create("./test.pdf", default_config, images.len()).unwrap();
for image in images {
   file.add_page_from_path(&image, Some(format!("Image: {}", image)), None)
       .unwrap();
}
file.finish().unwrap();

Structs

A PDF file
Config of a single page

Enums

Alignment of the image
Page margin, default is None
Page size, default is A4

Functions

An alias of scannedpdf::PDF::create_file