Merge pull request #19779 from danielpetri1/PR-19707

fix(bbb-export-annotations): Flag to force CairoSVG to embed images
This commit is contained in:
Anton Georgiev 2024-03-27 22:45:52 -04:00 committed by GitHub
commit 8502b50d1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 26 additions and 10 deletions

View File

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

View File

@ -11,9 +11,11 @@ logger.info('Running bbb-export-annotations');
(async () => { (async () => {
const client = redis.createClient({ const client = redis.createClient({
host: config.redis.host,
port: config.redis.port,
password: config.redis.password, password: config.redis.password,
socket: {
host: config.redis.host,
port: config.redis.port
}
}); });
await client.connect(); await client.connect();

View File

@ -25,9 +25,11 @@ const jobType = exportJob.jobType;
async function collectAnnotationsFromRedis() { async function collectAnnotationsFromRedis() {
const client = redis.createClient({ const client = redis.createClient({
host: config.redis.host,
port: config.redis.port,
password: config.redis.password, password: config.redis.password,
socket: {
host: config.redis.host,
port: config.redis.port
}
}); });
client.on('error', (err) => logger.info('Redis Client Error', err)); client.on('error', (err) => logger.info('Redis Client Error', err));

View File

@ -20,9 +20,11 @@ const exportJob = JSON.parse(job);
* sending a message through Redis PubSub */ * sending a message through Redis PubSub */
async function notifyMeetingActor() { async function notifyMeetingActor() {
const client = redis.createClient({ const client = redis.createClient({
host: config.redis.host,
port: config.redis.port,
password: config.redis.password, password: config.redis.password,
socket: {
host: config.redis.host,
port: config.redis.port
}
}); });
await client.connect(); await client.connect();

View File

@ -794,9 +794,11 @@ function overlay_annotations(svg, currentSlideAnnotations) {
// Process the presentation pages and annotations into a PDF file // Process the presentation pages and annotations into a PDF file
async function process_presentation_annotations() { async function process_presentation_annotations() {
const client = redis.createClient({ const client = redis.createClient({
host: config.redis.host,
port: config.redis.port,
password: config.redis.password, password: config.redis.password,
socket: {
host: config.redis.host,
port: config.redis.port
}
}); });
await client.connect(); await client.connect();
@ -868,11 +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),
...(config.process.cairoSVGUnsafeFlag ? ['-u'] : []),
'-o', PDFfile, '-o', PDFfile,
]; ];