Update 20240909
This commit is contained in:
41
DOCGEN/Klassen/SyncFPowerPoint.cs
Normal file
41
DOCGEN/Klassen/SyncFPowerPoint.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Syncfusion.Presentation;
|
||||
using Syncfusion.XlsIO;
|
||||
|
||||
namespace DOCGEN.Klassen
|
||||
{
|
||||
public class SyncFPowerPoint
|
||||
{
|
||||
public bool create_nativ(string property, string value, string base64, string originalfile, string destfile)
|
||||
{
|
||||
FileStream ms = new FileStream(originalfile, FileMode.Open, FileAccess.Read);
|
||||
//FileStream os = new FileStream(destfile, FileMode.Create);
|
||||
IPresentation pptxDoc = Presentation.Open(originalfile);
|
||||
try
|
||||
{
|
||||
pptxDoc.CustomDocumentProperties.Add(property);
|
||||
pptxDoc.CustomDocumentProperties[property].Value = value;
|
||||
}
|
||||
catch
|
||||
{
|
||||
pptxDoc.CustomDocumentProperties.Add(property);
|
||||
pptxDoc.CustomDocumentProperties[property].Value = value;
|
||||
|
||||
}
|
||||
ms.Close();
|
||||
ms.Dispose();
|
||||
pptxDoc.Save(destfile);
|
||||
|
||||
//os.Close();
|
||||
//os.Dispose();
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user