1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! # CarbonPDF
//!
//! Production-ready HTML to PDF conversion using Headless Chrome.
//!
//! CarbonPDF provides a safe, ergonomic API for converting HTML content to PDF documents
//! using Headless Chrome via the Chrome DevTools Protocol. It's designed for backend
//! services, CI/CD pipelines, and any application requiring high-quality PDF generation.
//!
//! ## Why Headless Chrome?
//!
//! - **Accurate rendering**: Chrome's rendering engine ensures PDFs match web output exactly
//! - **Modern web standards**: Full support for CSS3, JavaScript, web fonts, and flexbox/grid
//! - **Battle-tested**: Leverages the same engine used by billions of users daily
//!
//! ## Architecture
//!
//! CarbonPDF uses a layered architecture:
//! - **Public API**: Ergonomic builder pattern for common use cases
//! - **Renderer trait**: Abstraction allowing multiple backend implementations
//! - **Chrome backend**: Production-ready Chrome DevTools Protocol integration
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use carbonpdf::{PdfBuilder, PageSize, Result};
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! // Convert HTML string to PDF
//! let pdf = PdfBuilder::new()
//! .html("<h1>Hello, PDF!</h1>")
//! .page_size(PageSize::A4)
//! .margin_all(1.0)
//! .build()
//! .await?;
//!
//! std::fs::write("output.pdf", pdf)?;
//! Ok(())
//! }
//! ```
//!
//! ## Feature Flags
//!
//! - `chrome` (default): Enable Chrome backend via chromiumoxide
//! - `cli`: Build the `carbonpdf` CLI tool
// Re-export commonly used types
pub use PdfBuilder;
pub use ;
pub use ;
pub use InputSource;
pub use PdfRenderer;
pub use render_template;
pub use ChromeRenderer;
/// Library version
pub const VERSION: &str = env!;