use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Parse error: {message} at position {position}")]
Parse { message: String, position: usize },
#[error("Invalid PDF structure: {0}")]
InvalidStructure(String),
#[error("Missing required object: {0}")]
MissingObject(String),
#[error("Invalid object type: expected {expected}, got {actual}")]
InvalidObjectType { expected: String, actual: String },
#[error("Unsupported feature: {0}")]
Unsupported(String),
#[error("SVG error: {0}")]
Svg(String),
#[error("Encoding error: {0}")]
Encoding(String),
#[error("Compression error: {0}")]
Compression(String),
#[error("Font error: {0}")]
Font(String),
#[error("Image error: {0}")]
Image(String),
}