Crate jpeg_to_pdf[][src]

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::create_pdf_from_jpegs;
 
let one = fs::read("one.jpg").unwrap();
let two = fs::read("two.jpg").unwrap();
let three = fs::read("three.jpg").unwrap();

let out_file = File::create("out.pdf").unwrap();
create_pdf_from_jpegs(vec![one, two, three], &mut BufWriter::new(out_file), None).unwrap();

Structs

Error

An error that might occur while creating a PDF from JPEGs.

Enums

Cause

Things that might go wrong while creating a PDF from JPEGs.

Functions

create_pdf_from_jpegs

Creates a PDF file from the provided JPEG data.