Comments (15)
@EsterBergen Can you please tell us how to use this new Preview API exportAsBase64(), we are facing issue on using this api to convert ppt file to base64? Sample code would work. Thanks!
slide.exportAsBase64();
from office-js.
@vasuki-devi Thanks for letting us know. Tagging @EsterBergen to take a look.
Thanks.
from office-js.
Hi @vasuki-devi - Thanks for submitting this. Can you confirm that the conversion to Base64 working on your end?
When I use the preview APIS to export to base 64 and then use insertSlidesFromBase64(), it works fine and formatting/shapes are the same.
Can you try using this api to convert the slide to be inserted to base 64 and then insert that?
Here are more details: PowerPoint.Slide class - Office Add-ins | Microsoft Learn
from office-js.
We are using the Java.Util.Base64 encoder for converting pptx files to base64 format and is working fine from our end.
Still we are facing the formatting/shapes issues for the entire file of more than 10 files too.
Uploading Billing_model_comparison_single.pptx…
from office-js.
@EsterBergen Any update on this issue? We have a lot of customers using this feature, so any kind of information on this issue would be highly helpful. Thanks.
from office-js.
@vasuki-devi -- when i use the new preview api to exportAsBase64(), I don't have the same issue of different formats when inserting it into the presentation.
Have you tried that preview API for the export?
Here are more details: PowerPoint.Slide class - Office Add-ins | Microsoft Learn
from office-js.
Any update on this would be helpful?
from office-js.
We tried converting this sample file to base64 using normal converters in online as well as using Java.Util.Base64 but still facing the same issue on inserting slides with different format and styles. Any help on this? @EsterBergen
Billing_model_comparison_single.pptx
from office-js.
@vasuki-devi Apologies for the delay. For the new Preview API, you'll want to reference the Beta API library https://appsforoffice.microsoft.com/lib/beta/hosted/office.js
PowerPoint.Slide class - Office Add-ins | Microsoft Learn
from office-js.
Can you try two other things?
- Update the insert code to remove the part of keep source formatting. When i try it, I don't define that and am able to get the formatting to hold.
Can you try this?
`` await PowerPoint.run(async (context) => {
const currentSlide = context.presentation.getSelectedSlides().getItemAt(0);
currentSlide.load("id");
await context.sync();
context.presentation.insertSlidesFromBase64(base64, { targetSlideId: currentSlide.id });
});
}``
- Ensure that Designer is not running on your slide after they are inserted
from office-js.
Thanks for the update @EsterBergen
It doesn't work though when we apply slides from another presentation file and not from the same file. We have both the usecases of "Keep Source Formatting" and "Use Destination" which doesn't working.
Also, we are converting the entire ppt file to be inserted using "insertSlidesFromBase64" and not the active ppt's individual slide base 64 conversion.
Alternate solution would be helpful for our usecase.
UseCases:
- Apply another PPT base64 with source formatting
- Apply another PPT base64 with destination formatting
Note:
exportAsBase64() works only on individual slide base64 conversion and which is beta version cannot be used in production cases. Java.Util.Base64 mime encoded value is used from our side for the entire PPT file conversion.
Thanks in advance!
from office-js.
HI @vasuki-devi - Using the preview API, I exported a slide as a base64 string and then inserted it into a new presentation. I observe the following: 1) All formatting is the same as the source if I don't define formatting. 2) All formatting is the same as the source if I say "KeepSourceFormatting", 3) Destination formats are applied if I say formatting='UseSourceFormatting'.
Can you share the Base64 string of your slide that you're importing? I'm happy to test that result on my end too.
My guess is that Java.Util.Base64 does not accurately capture all of the formatting from PPT and therefore is the main culprit. As this is not an Office.js PPT API, I can't really provide feedback to enhance that API.
We're working to release exportAsBase64() to production and can keep you updated with those timelines when the API will be generally available.
You are correct that this export is for a single slide. We have it on our backlog to make improvements and export multiple slides. The timeline for that has yet to be determined. I'll consider this as a feature request to have that expanded to include multiple slides.
Please let me know if there are any other questions!
from office-js.
Thanks for the update! @EsterBergen
Have attached the files containing base64 values of a pptx file that has similar formatting and alignment issues.
We are happy to hear about the version release planning dates for exportAsBase64() API enhancements to support base64 conversion.
Attached is the combination of single base64 value, uploaded as separate files due to file upload size limits to 25MB as an attachment here.
Uploading Test-Part1.txt…
Uploading Test-Part2.txt…
from office-js.
HI @vasuki-devi - I"m unable to download the files you attached unfortunately.
We'll be sure to provide updates here when we can on the release of the preview API beyond insiders.
from office-js.
That would be helpful!
Thanks much!
from office-js.
Related Issues (20)
- body.clear() not working for content controls HOT 3
- How to make slide active Or How to insert image using index HOT 4
- Addin sample not showing in new look outlook and browsers. HOT 5
- Identifying Usage of New Outlook in Office-js Add-ins HOT 1
- Not able to sideload outlook addin. in macbook there is no option to add the manifest file HOT 5
- Inserting Signature with the OnMessageSend event duplicates the signature
- The identity API is not supported for this add-in in online Word HOT 2
- Excel Online: calculation state can get stuck in Pending state when workbook contains charts HOT 3
- IP Address Range Needed for Microsoft Office Add-in Validation Process
- Office API messageParent Outlook on android doesn't work
- NAA: Unable to acquire access token for event-based activation (onMessageSend) HOT 2
- Outlook addin using Bootstrap modal or offcanvas bleeds through on Mac version of Outlook. Classic and New Outlook for Mac. HOT 2
- [Word API] Document.compare: ability to specify Original and Revised document?
- Outlook NAA issue: "Something went wrong. [7q6cl]" Error HOT 5
- Web Outlook provides improper attachment data if attachment is still uploading to the email HOT 2
- [Question] Is it safe to use `CustomFunctions.delayinitialization()`
- New Outlook - emails stuck in outlook at queued or draft status HOT 3
- context.application.createDocument works only first time HOT 1
- WorkBook level Define name is getting corrupted while reopening excel using base64
- In Outlook, getAllInternetHeadersAsync works on an item in the Inbox, but not the sent folder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from office-js.