use std::collections::HashMap;
use fop_types::{Gradient, Length};
use crate::pdf::compliance::PdfCompliance;
use crate::pdf::font::FontManager;
use crate::pdf::image::ImageXObject;
use crate::pdf::security::EncryptionDict;
#[derive(Clone)]
pub struct PdfGradient {
pub gradient: Gradient,
pub object_id: usize,
}
#[derive(Clone, Debug)]
pub struct PdfExtGState {
pub fill_opacity: f64,
pub stroke_opacity: f64,
pub object_id: usize,
}
#[derive(Debug, Clone)]
pub struct PdfOutline {
pub items: Vec<PdfOutlineItem>,
}
#[derive(Debug, Clone)]
pub struct PdfOutlineItem {
pub title: String,
pub page_index: Option<usize>,
pub external_destination: Option<String>,
pub children: Vec<PdfOutlineItem>,
}
#[derive(Debug, Clone)]
pub struct PdfObject {
pub id: u32,
pub generation: u16,
pub content: PdfValue,
}
#[derive(Debug, Clone)]
pub enum PdfValue {
Null,
Boolean(bool),
Integer(i32),
Real(f64),
String(String),
Name(String),
Array(Vec<PdfValue>),
Dictionary(HashMap<String, PdfValue>),
Stream(Vec<u8>),
}
#[derive(Debug, Clone)]
pub struct LinkAnnotation {
pub rect: [f64; 4],
pub destination: LinkDestination,
}
#[derive(Debug, Clone)]
pub enum LinkDestination {
External(String),
Internal(String),
}
pub struct PdfPage {
pub width: Length,
pub height: Length,
pub content: Vec<u8>,
pub link_annotations: Vec<LinkAnnotation>,
}
#[derive(Debug, Clone, Default)]
pub struct PdfInfo {
pub title: Option<String>,
pub author: Option<String>,
pub subject: Option<String>,
pub creation_date: Option<String>,
pub lang: Option<String>,
}
pub struct PdfDocument {
pub version: String,
pub objects: Vec<PdfObject>,
pub pages: Vec<PdfPage>,
pub info: PdfInfo,
pub image_xobjects: Vec<ImageXObject>,
pub gradients: Vec<PdfGradient>,
pub ext_g_states: Vec<PdfExtGState>,
pub outline: Option<PdfOutline>,
pub font_manager: FontManager,
pub encryption: Option<EncryptionDict>,
pub file_id: Option<Vec<u8>>,
pub compliance: PdfCompliance,
}