feat: support creation-timestamp configuration for exporting PDF (#439)

* feat: support creation-timestamp configuration for exporting PDF

* fix: respect config
This commit is contained in:
Myriad-Dreamin 2024-07-20 06:58:27 +08:00 committed by GitHub
parent 25c449c2b2
commit 103e0f3b3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 97 additions and 16 deletions

View file

@ -143,10 +143,11 @@ mod polymorphic {
Merged,
}
#[derive(Debug, Clone, Default)]
#[derive(Debug, Clone)]
pub enum ExportKind {
#[default]
Pdf,
Pdf {
creation_timestamp: Option<chrono::DateTime<chrono::Utc>>,
},
Svg {
page: PageSelection,
},
@ -155,10 +156,18 @@ mod polymorphic {
},
}
impl Default for ExportKind {
fn default() -> Self {
Self::Pdf {
creation_timestamp: None,
}
}
}
impl ExportKind {
pub fn extension(&self) -> &str {
match self {
Self::Pdf => "pdf",
Self::Pdf { .. } => "pdf",
Self::Svg { .. } => "svg",
Self::Png { .. } => "png",
}