-
Notifications
You must be signed in to change notification settings - Fork 101
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
Office add-in PPT getFileAsync -> FileType.Pdf #5399
Comments
Here are some similar issues that might help you. Please check if they can solve your problem. Powered by issue-sentinel |
Here are some similar issues that might help you. Please check if they can solve your problem. Powered by issue-sentinel |
I tried the tutorials but it seems to give the same error |
Hi, @cristrasp Can you provide a fully runnable code snippet? Since there are no line breaks, I can’t run it directly, so I’m not sure how my code differs from yours. Also, are you running it on Desktop, Online, or Mac OS? At least for me, the code here works fine on PowerPoint Desktop, you can import it into Script Lab and run it directly. Best regards, |
We are using online but would want to be able to use it mac and desktop too . |
`
|
This is the code that we are using to get the PPT in PDF format @guoms1 |
Hi, @cristrasp I was able to reproduce this issue(#9821668) on PowerPoint Online. I'll be reaching out to the relevant team for further investigation. Thanks for your patience! Best, |
We are using Office.js for our add-in in PowerPoint. We are trying to use getFileAsync like in this method
loadFileBlob(officeDoc: OfficeDoc): Promise<OfficeDoc> { const Office = (window as any).Office; console.log(Office.context, 'conteXT') return new Promise((resolve, reject) => { Office.context.document.getFileAsync( Office.FileType.Pdf, { sliceSize: 65536 }, (asyncResult: any) => { if (asyncResult.status === Office.AsyncResultStatus.Failed) { reject(asyncResult); } else { const file = asyncResult.value; if (file.size > 10485760) { // 10mb file.closeAsync(); asyncResult.size = file.size; reject(asyncResult); } else { this.getAllSlices(file) .then((docData: any) => { let fileContent = new String(); for (let j = 0; j < docData.length; j++) { fileContent += String.fromCharCode(docData[j]); } officeDoc.blob = this.fileUtilsService.getBlobFromBinaryString( fileContent.toString() ); resolve(officeDoc); }) .catch((err: any) => { reject(err); }); } } } ); }); }
In word and excel it works fine but in PPT even if it's written that is supported it gives a 5001 .
-Office.FileType.Pdf -> it doesn't work , but it what we need and in docs it's written that is supported.
-Office.FileType.Compressed -> it works but we don't need it .
The text was updated successfully, but these errors were encountered: