Skip to content
Open
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.
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Aspose.Slides.NET" Version="25.3.0" />
<PackageReference Include="MimeTypesMap" Version="1.0.8" />
<PackageReference Include="RazorEngineCore" Version="2023.11.2" />
<PackageReference Include="Aspose.Slides.NET" Version="25.8.0" />
<PackageReference Include="MimeTypesMap" Version="1.0.9" />
<PackageReference Include="RazorEngineCore" Version="2024.4.1" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Aspose.Slides.WebExtensions/Helpers/ShapeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static Bitmap GetShapeThumbnail(IShape shape)
AutoShape autoShape = shape as AutoShape;

Bitmap thumbnail;
if (autoShape != null && !string.IsNullOrEmpty(autoShape.TextFrame.Text))
if (autoShape != null && autoShape.TextFrame != null && !string.IsNullOrEmpty(autoShape.TextFrame.Text))
{
// Copy shape paragraphs -> remove text -> get shape image -> restore paragraphs. Export text as HTML markup in the template.
List<Paragraph> paraColl = new List<Paragraph>();
Expand Down
2 changes: 1 addition & 1 deletion Examples/SinglePageApp/SinglePageApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Aspose.Slides.NET">
<Version>25.3.0</Version>
<Version>25.8.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down