Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created September 16, 2021 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfjedimaster/29df7ce562c593612a85096aaed7f285 to your computer and use it in GitHub Desktop.
Save cfjedimaster/29df7ce562c593612a85096aaed7f285 to your computer and use it in GitHub Desktop.
exportPdfToImagesOperation.execute(executionContext)
.then(result => {
let saveFilesPromises = [];
for(let i = 0; i < result.length; i++){
saveFilesPromises.push(result[i].saveAsFile(`output/exportPDFToJPEGOutput_${i}.jpeg`));
}
return Promise.all(saveFilesPromises);
})
.catch(err => {
if(err instanceof PDFServicesSdk.Error.ServiceApiError
|| err instanceof PDFServicesSdk.Error.ServiceUsageError) {
console.log('Exception encountered while executing operation', err);
} else {
console.log('Exception encountered while executing operation', err);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment