Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created August 2, 2024 15:52
Show Gist options
  • Save cfjedimaster/1644062ed7faef52ff0347adc79481f9 to your computer and use it in GitHub Desktop.
Save cfjedimaster/1644062ed7faef52ff0347adc79481f9 to your computer and use it in GitHub Desktop.
pollingURL = await pdfServices.submit({job});
response = await pdfServices.getJobResult({
pollingURL,
resultType: ProtectPDFResult
});
// Get content from the resulting asset(s)
let streamAsset = await pdfServices.getContent({ asset: response.result.asset});
streamAsset.readStream.pipe(fs.createWriteStream('./output_protected.pdf'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment