From 2c3939d1478ecf434ccb5e9075849e2bd0e045a0 Mon Sep 17 00:00:00 2001 From: danielpetri1 Date: Mon, 11 Mar 2024 21:18:39 +0000 Subject: [PATCH] Set CairoSVG unsafe flag --- bbb-export-annotations/config/settings.json | 3 ++- bbb-export-annotations/workers/process.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bbb-export-annotations/config/settings.json b/bbb-export-annotations/config/settings.json index 8352a33b80..d5e46856d6 100644 --- a/bbb-export-annotations/config/settings.json +++ b/bbb-export-annotations/config/settings.json @@ -20,7 +20,8 @@ "maxImageHeight": 1080, "textScaleFactor": 2, "pointsPerInch": 72, - "pixelsPerInch": 96 + "pixelsPerInch": 96, + "cairoSVGUnsafeFlag": true }, "notifier": { "pod_id": "DEFAULT_PRESENTATION_POD", diff --git a/bbb-export-annotations/workers/process.js b/bbb-export-annotations/workers/process.js index 86ab5757ea..2107f0d5a1 100644 --- a/bbb-export-annotations/workers/process.js +++ b/bbb-export-annotations/workers/process.js @@ -870,12 +870,18 @@ async function process_presentation_annotations() { } }); - // Scale slide back to its original size +/** + * Constructs the command arguments for converting an annotated slide from SVG to PDF format. + * `cairoSVGUnsafeFlag` should be enabled (true) for CairoSVG versions >= 2.7.0 + * to allow external resources, such as presentation slides, to be loaded. + * + * @const {string[]} convertAnnotatedSlide - The command arguments for the conversion process. + */ const convertAnnotatedSlide = [ SVGfile, '--output-width', to_px(slideWidth), '--output-height', to_px(slideHeight), - '-u', + ...(config.process.cairoSVGUnsafeFlag ? ['-u'] : []), '-o', PDFfile, ];