use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error("PDF parsing error: {0}")]
PdfParse(String),
#[error("PDF writing error: {0}")]
PdfWrite(String),
#[error("Invalid page: {0}")]
InvalidPage(String),
#[error("Invalid bounding box: {0}")]
InvalidBoundingBox(String),
#[error("Content stream parsing error: {0}")]
ContentStreamParse(String),
#[error("No content found on page {0}")]
EmptyPage(usize),
#[error("External tool error: {0}")]
External(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("PDF library error: {0}")]
Lopdf(#[from] lopdf::Error),
}