25 lines
553 B
C#
25 lines
553 B
C#
|
|
using System;
|
||
|
|
|
||
|
|
namespace BetterEN5.Services.Conversion;
|
||
|
|
|
||
|
|
public class ConversionEngine
|
||
|
|
{
|
||
|
|
private readonly PptxImporter _importer = new();
|
||
|
|
private readonly EnbxWriter _writer = new();
|
||
|
|
|
||
|
|
public bool Convert(string pptxPath, string enbxPath)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
var doc = _importer.Import(pptxPath);
|
||
|
|
_writer.Write(doc, enbxPath);
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
catch (Exception ex)
|
||
|
|
{
|
||
|
|
Console.Error.WriteLine($"Conversion failed: {ex}");
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|