#jpeg #pdf

bin+lib jpeg-to-pdf

Create PDFs from JPEG images

5 releases

0.2.3 Aug 10, 2021
0.2.2 Feb 24, 2021
0.2.1 Feb 21, 2021
0.2.0 Feb 19, 2021
0.1.1 Jan 31, 2021

#65 in #jpeg

Download history 4/week @ 2024-02-16 14/week @ 2024-02-23 8/week @ 2024-03-01 5/week @ 2024-03-08 2/week @ 2024-03-15 45/week @ 2024-03-29

53 downloads per month

MIT/Apache

165KB
406 lines

A crate for creating PDFs from JPEG images.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

Creates PDFs from JPEG images.

Images are embedded directly in the PDF, without any re-encoding.

Example

use std::fs::{self, File};
use std::io::BufWriter;

use jpeg_to_pdf::JpegToPdf;

let out_file = File::create("out.pdf").unwrap();

JpegToPdf::new()
    .add_image(fs::read("one.jpg").unwrap())
    .add_image(fs::read("two.jpg").unwrap())
    .add_image(fs::read("three.jpg").unwrap())
    .create_pdf(&mut BufWriter::new(out_file))
    .unwrap();

Dependencies

~21MB
~181K SLoC