diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-05-30 10:31:05 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-05-30 10:31:05 +0200 |
| commit | 757615dc420b00e52eed6aad11595828e9101ba1 (patch) | |
| tree | e008e76debb3b73f64d784fec4eddf8f97f91014 /src/export | |
| parent | 26a427a3216c8e96f1f6b79eb6f1e9b1f09c3d25 (diff) | |
Fix color space definitions
Diffstat (limited to 'src/export')
| -rw-r--r-- | src/export/pdf.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/export/pdf.rs b/src/export/pdf.rs index 6b5b6a8a..46f3d389 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -37,8 +37,8 @@ pub fn pdf(ctx: &Context, frames: &[Arc<Frame>]) -> Vec<u8> { } /// Identifies the color space definitions. -const SRGB: Name<'static> = Name(b"sRGB"); -const SRGB_GRAY: Name<'static> = Name(b"sRGBGray"); +const SRGB: Name<'static> = Name(b"srgb"); +const SRGB_GRAY: Name<'static> = Name(b"srgbgray"); /// An exporter for a whole PDF document. struct PdfExporter<'a> { @@ -365,12 +365,10 @@ impl<'a> PdfExporter<'a> { pages.count(page_refs.len() as i32).kids(page_refs); let mut resources = pages.resources(); - resources.color_spaces().insert(SRGB).start::<ColorSpace>().srgb(); - resources - .color_spaces() - .insert(SRGB_GRAY) - .start::<ColorSpace>() - .srgb_gray(); + let mut spaces = resources.color_spaces(); + spaces.insert(SRGB).start::<ColorSpace>().srgb(); + spaces.insert(SRGB_GRAY).start::<ColorSpace>().srgb_gray(); + spaces.finish(); let mut fonts = resources.fonts(); for (font_ref, f) in self.face_map.pdf_indices(&self.face_refs) { |
