Set CairoSVG unsafe flag

This commit is contained in:
danielpetri1 2024-03-11 21:18:39 +00:00
parent 25e619a4f6
commit 2c3939d147
2 changed files with 10 additions and 3 deletions

View File

@ -20,7 +20,8 @@
"maxImageHeight": 1080, "maxImageHeight": 1080,
"textScaleFactor": 2, "textScaleFactor": 2,
"pointsPerInch": 72, "pointsPerInch": 72,
"pixelsPerInch": 96 "pixelsPerInch": 96,
"cairoSVGUnsafeFlag": true
}, },
"notifier": { "notifier": {
"pod_id": "DEFAULT_PRESENTATION_POD", "pod_id": "DEFAULT_PRESENTATION_POD",

View File

@ -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 = [ const convertAnnotatedSlide = [
SVGfile, SVGfile,
'--output-width', to_px(slideWidth), '--output-width', to_px(slideWidth),
'--output-height', to_px(slideHeight), '--output-height', to_px(slideHeight),
'-u', ...(config.process.cairoSVGUnsafeFlag ? ['-u'] : []),
'-o', PDFfile, '-o', PDFfile,
]; ];