Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timeout to pdf buffering for slide #251

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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