From 757615dc420b00e52eed6aad11595828e9101ba1 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 30 May 2022 10:31:05 +0200 Subject: [PATCH] Fix color space definitions --- src/export/pdf.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/export/pdf.rs b/src/export/pdf.rs index 6b5b6a8ac..46f3d389a 100644 --- a/src/export/pdf.rs +++ b/src/export/pdf.rs @@ -37,8 +37,8 @@ pub fn pdf(ctx: &Context, frames: &[Arc]) -> Vec { } /// 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::().srgb(); - resources - .color_spaces() - .insert(SRGB_GRAY) - .start::() - .srgb_gray(); + let mut spaces = resources.color_spaces(); + spaces.insert(SRGB).start::().srgb(); + spaces.insert(SRGB_GRAY).start::().srgb_gray(); + spaces.finish(); let mut fonts = resources.fonts(); for (font_ref, f) in self.face_map.pdf_indices(&self.face_refs) {