Skip to content

Commit

Permalink
Add timeout to pdf buffering for slide
Browse files Browse the repository at this point in the history
  • Loading branch information
aleciavogel authored and astefanutti committed Nov 29, 2022
1 parent 385363b commit 3114e7e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions decktape.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ parser.script('decktape').options({
default: 20000,
help: 'Timeout in milliseconds to use when waiting for the slide deck page to load',
},
bufferTimeout: {
full: 'buffer-timeout',
metavar: '<ms>',
default: 30000,
help: 'Timeout in milliseconds to use when waiting for a slide to finish buffering (set to 0 to disable)',
},
screenshots : {
default : false,
flag : true,
Expand Down Expand Up @@ -387,6 +393,7 @@ async function exportSlide(plugin, page, pdf, context) {
printBackground : true,
pageRanges : '1',
displayHeaderFooter : false,
timeout : options.bufferTimeout,
});
await printSlide(pdf, await PDFDocument.load(buffer, { parseSpeed: ParseSpeeds.Fastest }), context);
context.exportedSlides++;
Expand Down

0 comments on commit 3114e7e

Please sign in to comment.