We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to save in same format as original document

with the last release of aspose.slides 14.2.0, the .write method was removed and is a known backward compatibility issue. most of your documentation online still references it so that is one thing you should look into updating, but my question is what would be the best way to save an already opened presentation back to its original format to a stream. the Save method requires a format to save to, but I would like to figure that out programmatically. or is there some other method other than Save?

Hi Kirk,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Yes, you are correct that Presentation.Write method is not present anymore in our new version of Aspose.Slides for .NET and instead Save method will be used for saving any format file. As this version is released very recently, we are in process of updating our documentation. Now regarding knowing the format programmatically in which the file was loaded, you can use Presentation.SourceFormat property to identify in which format file was loaded and use that to save the file in the required format using Save method. Hopefully, this will resolve the issue at your end.

Thanks & Regards,

From what I could tell, SourceFormat is a string, but the format parameter in Save is an enum. Does the string in SourceFormat represent an enum value or is it something else. My hope would be to just convert the string to enum value, but if I need to build a switch statement to determine the enum value based on what is in the string, I guess that will have to do.

Hi Kirk,


Thank you for the feedback.


You will need to use the
switch statement with
SourceFormat as it is different from SaveFormat
enum.


Thanks & Regards,

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>