pdf_converter/lib.rs
1//! # PDF Converter
2//!
3//! A simple library for converting JPG and other image formats to PDF documents.
4//!
5//! ## Features
6//!
7//! - Convert single images to PDF
8//! - Batch convert multiple images from a folder to a single PDF
9//! - Support for JPG, PNG, GIF, BMP, WebP formats
10//! - Automatic A4 page fitting with proper scaling
11//! - Configurable margins and page settings
12//!
13//! ## Example
14//!
15//! ```rust
16//! use pdf_converter::PdfConverter;
17//!
18//! let converter = PdfConverter::new();
19//! converter.convert_folder_to_pdf("images/", "output.pdf")?;
20//! ```
21
22pub mod converter;
23pub mod error;
24
25pub use converter::{PdfConverter, PdfConfig};
26pub use error::{PdfError, Result};
27
28/// Default A4 page width in millimeters
29pub const A4_WIDTH_MM: f32 = 210.0;
30
31/// Default A4 page height in millimeters
32pub const A4_HEIGHT_MM: f32 = 297.0;
33
34/// Default page margin in millimeters
35pub const DEFAULT_MARGIN_MM: f32 = 20.0;
36
37/// Default DPI for image conversion
38pub const DEFAULT_DPI: f32 = 300.0;