Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Aspose.Slides.WebExtensions.Tests/SLIDESNET_45094.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using Aspose.Slides.Export;
using Aspose.Slides.Export.Web;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.IO;

namespace Aspose.Slides.WebExtensions.Tests
{
[TestClass]
public class SLIDESNET_45094
{
[TestMethod]
public void Test_45094()
{
var RootDirectory = Path.GetFullPath("../../../");
var PresentationFilePath = Path.Combine(RootDirectory, "TestData", "SLIDESNET_45094", "SLIDESNET-45094.ppt");
var EthalonPath = Path.Combine(RootDirectory, "TestData", "SLIDESNET_45094", "html");
var TemplatePath = Path.Combine(RootDirectory, "TestData", "Out", "templates");
var OutputPath = Path.Combine(RootDirectory, "TestData", "Out", "SLIDESNET_45094");

var sourcePath1 = Path.GetFullPath(Path.Combine(RootDirectory, "..", "Aspose.Slides.WebExtensions", "templates", "single-page"));
var sourcePath2 = Path.GetFullPath(Path.Combine(RootDirectory, "..", "Aspose.Slides.WebExtensions", "templates", "common"));

Directory.CreateDirectory(OutputPath);
Directory.CreateDirectory(TemplatePath);

foreach (string dirPath in Directory.GetDirectories(sourcePath1, "*", SearchOption.AllDirectories)) Directory.CreateDirectory(dirPath.Replace(sourcePath1, TemplatePath));
foreach (string newPath in Directory.GetFiles(sourcePath1, "*.*", SearchOption.AllDirectories)) File.Copy(newPath, newPath.Replace(sourcePath1, TemplatePath), true);

foreach (string dirPath in Directory.GetDirectories(sourcePath2, "*", SearchOption.AllDirectories)) Directory.CreateDirectory(dirPath.Replace(sourcePath2, TemplatePath));
foreach (string newPath in Directory.GetFiles(sourcePath2, "*.*", SearchOption.AllDirectories)) File.Copy(newPath, newPath.Replace(sourcePath2, TemplatePath), true);

using (Presentation pres = new Presentation(PresentationFilePath))
{
WebDocument document = pres.ToSinglePageWebDocument(
new WebDocumentOptions()
{
EmbedImages = true
},
TemplatePath,
OutputPath);
document.Save();
}
}
}
}
Binary file not shown.