diff options
Diffstat (limited to 'crates/typst-pdf')
| -rw-r--r-- | crates/typst-pdf/Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/typst-pdf/src/lib.rs | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/crates/typst-pdf/Cargo.toml b/crates/typst-pdf/Cargo.toml index cdd65e82..64229945 100644 --- a/crates/typst-pdf/Cargo.toml +++ b/crates/typst-pdf/Cargo.toml @@ -27,6 +27,7 @@ miniz_oxide = { workspace = true } once_cell = { workspace = true } pdf-writer = { workspace = true } arrayvec = { workspace = true } +serde = { workspace = true } subsetter = { workspace = true } svg2pdf = { workspace = true } ttf-parser = { workspace = true } diff --git a/crates/typst-pdf/src/lib.rs b/crates/typst-pdf/src/lib.rs index 587f66cb..7df77f10 100644 --- a/crates/typst-pdf/src/lib.rs +++ b/crates/typst-pdf/src/lib.rs @@ -21,6 +21,7 @@ use std::ops::{Deref, DerefMut}; use base64::Engine; use pdf_writer::{Chunk, Name, Pdf, Ref, Str, TextStr}; +use serde::{Deserialize, Serialize}; use typst::diag::{bail, SourceResult, StrResult}; use typst::foundations::{Datetime, Smart}; use typst::layout::{Abs, Em, PageRanges, Transform}; @@ -128,16 +129,18 @@ impl Default for PdfStandards { } } -/// A PDF standard. +/// A PDF standard that Typst can enforce conformance with. /// /// Support for more standards is planned. -#[derive(Debug, Copy, Clone, Eq, PartialEq)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)] #[allow(non_camel_case_types)] #[non_exhaustive] pub enum PdfStandard { /// PDF 1.7. + #[serde(rename = "1.7")] V_1_7, /// PDF/A-2b. + #[serde(rename = "a-2b")] A_2b, } |
