Free Support Forum - aspose.cloud

Convert PowerPoint Presentation slides to PNG with embedded fonts in Nodejs using Aspose.Slides REST API

Hello,


We are very interested in the Aspose.Slides Cloud service, specifically to convert powerpoint presentations into sets of PNGs. In a quick look of the API, that definitely looks possible.

However, two questions:

(1) I wondered if the Cloud service supported embedded fonts inside of PPTX? Meaning, if someone embedded a font like Frutiger inside of the Powerpoint file, would the text shown in the rendered PNG be in Frutiger?

(2) Also, are there any complete examples of uploading a pptx file and saving out all slides as PNGs (or saving it as html with pngs)? I see partial examples in the various SDKs, API test bed, etc. but no start-to-finish example. (I would prefer to see using node.js but I would be fine with any language example that showed start to finish.)

Thanks,
Rich

Hi Rich,


Thank you for your interest in Aspose.Slides.

I have observed your comments and like to share with you that if the presentation has embedded fonts inside that, Aspose.Slides will export the presentation to thumbnail by using the embedded fonts if they have been utilized in presentation.

I have created a complete demo as per your requirements using python on my end. Please find attached the “Slides.rar” and then execute the uploadexample.py and then pptxImages.py to create the image of slides after specifying the App SID and App Key. Output.jpg is the generated output file on my end.

I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,

Thanks much for your reply. I was able to look at your python scripts and do the equivalent in Node.js! One question - I was trying to customize the size of the output image using:


AsposeSlides.prototype.convertToImagebySize = function(fileName,slideNumber,saveFormat,width,height,folderName,storageName,callback)

However, the output png is always coming back sized 720x540 regardless of what I specify in the width and height params. For example:

slides.convertToImagebySize(“deck1.pptx”, 1, “png”, 1440, 1080, “”, “”, function(data){
var outputFile = fs.createWriteStream(“output.png”);
outputFile.write(data);
outputFile.end();
});

Is this a bug? Or what can I do?

Thanks much.
Rich



Just to confirm, I even tried using the SDK sample code below, the only change being my particular Powerpoint deck. Same result. 720x540, not 800x600.


var file = “deck1.pptx”;
var slide = 1;
var format = “png”;
var width = 800;
var height = 600;
var outputFile = “Slide1.png”;

slides.convertToImagebySize(file, slide, format, width, height, “”, “”, function(buffer) {
fs.writeFileSync(outputFile, buffer);
console.log(“File saved:”, outputFile);
});


Hi Rich,


I have observed your comments and worked over your requirements. I am able to create thumbnail with custom size. I have attached the generated output image as well. I request you to please check this API Method for your kind reference.

Best Regards,

Thanks for your reply. Unfortunately, the output file in my test still doesn’t conform to my width/height settings. I am using nearly identical code to what you reference above. Also, I even tried a second pptx file to see if it was something particular about the first one. But same results. Let me provide more details.


First, here’s the file I uploading:

https://dl.dropboxusercontent.com/u/2405581/maark/amazing.pptx

Second, here’s my upload script:

var asposeapp = new AsposeCloud({‘appSID’:AppSID,‘appKey’:AppKey,‘baseURI’:BaseProductUri});
var storage = new AsposeStorage(asposeapp);

storage.uploadFile(“amazing.pptx”, “”, “”, function(data){
console.log(data);
});

Third, here’s my convert to image script:

var asposeapp = new AsposeCloud({‘appSID’:AppSID,‘appKey’:AppKey,‘baseURI’:BaseProductUri});
var slides = new AsposeSlides(asposeapp);

var file = “amazing.pptx”;
var slide = 1;
var format = “png”;
var width = 800;
var height = 600;
var outputFile = “Slide1.png”;

slides.convertToImagebySize(file, slide, format, width, height, “”, “”, function(buffer) {
fs.writeFileSync(outputFile, buffer);
console.log(“File saved:”, outputFile);
});

Fourth, here’s the output file:

https://dl.dropboxusercontent.com/u/2405581/maark/Slide1.png

(which is 960x540).

Questions:

1) Can you try on that sample pptx file (linked above) and see if output resize works for you?
2) Is there anything in the above upload or convert scripts that would prevent the resize? Again, those scripts are directly from your sample doc code, just with the file name updated.

Thanks!
Rich

A little more info to hopefully track down the issue...I traced the execution into the node.js aspose sdk and see that the URI for a small thumbnail GET request is:

http://api.aspose.com/v1.1/slides/uls1.pptx/slides/1?format=png&width204&height=102

But again, the result is a 720x540 on output. Thanks much!


Hi Rich,


We are investigating the issue reported by you and we will get back to you soon with our findings.

We appreciate your patience in this regard,

Adnan,


Thanks much for the update. The image resizing is critical to selecting Aspose.Slides/Cloud in a new app we are building. If you guys can do that, then we are going to go with you guys. Do you have an estimated time in which you will know more? We are looking to make a final decision by end of next week.

Thanks,
Rich

Hi Rich,


It is taking time for us to reproduce the issue with node.js. We will appreciate if you can share a zip file with us and the steps to reproduce this issue. This will of course speed up our investigations and we will be sharing our findings with you hopefully within a day of upcoming week.

Best Regards,

Sure thing. Here is a Zip that contains upload script for uploading the uls1.pptx file and convertSlide.js that attempts to convert and resize slide 1.

Hi Rich,


I have observed the file shared by you. I have the files with same code as well. I request you to please share with us a complete working sample code along with the sdk for Node.js, so that I only have to run that script on my side to reproduce the issue. Without moving any file anywhere but simply running the script.

We really appreciate your cooperation.

Best Regards,

attached is complete example - including node modules and your sdk.

Hi Rich,


Thank you for sharing the files. We will get back to you soon with our findings.

Best Regards,

Hi Rich,


Thank you for being patient.

I have worked with the files shared by you and I have been able to reproduce the issue on my end. A ticket with ID SAASSLIDES-178 has been logged into our issue management system for further investigation and resolution. This thread has been linked with the issue so that you may be automatically notified as soon as this issue will be fixed.

We are sorry for your inconvenience,

Thanks much for the update. Do you have a timeframe on the resolution of this issue? As indicated before, the ability to resize is critical to our project requirements. So, while we love your API and would love to be able to use it, we are looking to go with Zamzar unless this issue can be resolved soon.


Best regards,
Rich

Hi Rich,

Thank you for getting back to us.

I have observed your comments and like to share with you that this was an issue with the SDK which has been fixed in recent release. I request you to please download SDK from this link and then share your kind feedback with us.

Please let us know if the issue persists. We will be happy to assist you further.

Best Regards,

The issues you have found earlier (filed as SAASSLIDES-178) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.