Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

Convert macro-enabled PowerPoint templates (.potm)

Ganesh M186195346e69
diff --git a/README.ko.md b/README.ko.md
index 209495b6..9cfc61df 100644
--- a/README.ko.md
+++ b/README.ko.md
@@ -34,7 +34,7 @@
<table>
<tr>
<td width="33%" valign="top"><b>커서 바로 옆에서</b><br>앱 창을 열 필요가 없어요. 끌고 있는 파일에 맞는 형식만 지금 있는 자리에 나타나요.</td>
- <td width="33%" valign="top"><b>247가지 형식, 다른 프로그램 없이</b><br>이미지, PDF, 워드, 엑셀, 파워포인트, HWP, 전자책, 압축 파일, 글꼴, CAD, 3D 모델을 오피스·한컴오피스·LibreOffice 없이 변환해요.</td>
+ <td width="33%" valign="top"><b>248가지 형식, 다른 프로그램 없이</b><br>이미지, PDF, 워드, 엑셀, 파워포인트, HWP, 전자책, 압축 파일, 글꼴, CAD, 3D 모델을 오피스·한컴오피스·LibreOffice 없이 변환해요.</td>
<td width="33%" valign="top"><b>내 컴퓨터 안에서만</b><br>아무것도 업로드하지 않아요. 오프라인으로 동작하고 결과는 원본 옆에 저장해요.</td>
</tr>
</table>
@@ -91,7 +91,7 @@
| **PDF** | DOCX, HWPX, TXT, PNG, JPG, TIFF, CBZ, PPTX(페이지마다 그림 한 장), SVG²; 합치기, 나누기, 페이지 범위, 압축 (더 작은 PDF) |
| **문서**: DOCX, DOCM, DOTX, EML, Outlook MSG · DOC, ODT, FODT, OTT, RTF, WPS, WPD, Pages, ClarisWorks, MacWrite, T602 등² | PDF, DOCX, HWPX, EPUB, TXT, HTML; MSG → EML · ODT, FODT, OTT² |
| **스프레드시트**: XLSX, XLSM, XLS, XLT, ODS, CSV, TSV · OTS, FODS, Numbers, ET² | PDF, XLSX, ODS, CSV, TSV, JSON, HWPX, HTML · XLT, OTS² |
-| **프레젠테이션**: PPTX, PPTM, POTX, PPSX · PPT, ODP, OTP, FODP, Keynote² | PDF, PNG, JPG, DOCX, HWPX · OTP² |
+| **프레젠테이션**: PPTX, PPTM, POTX, POTM, PPSX · PPT, ODP, OTP, FODP, Keynote² | PDF, PNG, JPG, DOCX, HWPX · OTP² |
| **한글**: HWP, HWPX | PDF, PNG, DOCX, HWPX ↔ HWP, TXT, 마크다운, HTML |
| **텍스트**: TXT, 마크다운, HTML; MHTML(저장한 웹 페이지)은 읽기 · reStructuredText, LaTeX, Org, AsciiDoc, Typst, MediaWiki, DocBook, Jupyter, Textile, man, OPML³ | PDF, DOCX, HWPX, EPUB · 서로 변환, PPTX 슬라이드³ |
| **전자책**: EPUB, KEPUB, MOBI, AZW3, AZW, AZW4, FB2, CBZ, CBR, CB7, HTMLZ, TXTZ · LIT, LRF, CHM, PDB 등⁴ | PDF, EPUB, KEPUB(코보), DOCX, TXT, HTML, HWPX · MOBI, AZW3⁴ |
diff --git a/README.md b/README.md
index fd6b1ae9..769de2e2 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,7 @@
<table>
<tr>
<td width="33%" valign="top"><b>Right at your cursor</b><br>No app window to open. The formats appear where you already are, only the ones that make sense for the files you drag.</td>
- <td width="33%" valign="top"><b>247 formats, no other software</b><br>Images, PDF, Word, Excel, PowerPoint, HWP, e-books, archives, fonts, CAD and 3D models work without Office, Hancom Office or LibreOffice.</td>
+ <td width="33%" valign="top"><b>248 formats, no other software</b><br>Images, PDF, Word, Excel, PowerPoint, HWP, e-books, archives, fonts, CAD and 3D models work without Office, Hancom Office or LibreOffice.</td>
<td width="33%" valign="top"><b>Stays on your computer</b><br>Nothing is uploaded. Filee works offline and saves the result next to the original.</td>
</tr>
</table>
@@ -91,7 +91,7 @@ Filee shows new releases in its menu and updates itself, keeping your settings a
| **PDF** | DOCX, HWPX, TXT, PNG, JPG, TIFF, CBZ, PPTX (a picture of each page), SVG²; merge, split, page ranges, compress (smaller PDFs) |
| **Documents**: DOCX, DOCM, DOTX, EML, Outlook MSG · DOC, ODT, FODT, OTT, RTF, WPS, WPD, Pages, ClarisWorks, MacWrite, T602, …² | PDF, DOCX, HWPX, EPUB, TXT, HTML; MSG → EML · ODT, FODT, OTT² |
| **Spreadsheets**: XLSX, XLSM, XLS, XLT, ODS, CSV, TSV · OTS, FODS, Numbers, ET² | PDF, XLSX, ODS, CSV, TSV, JSON, HWPX, HTML · XLT, OTS² |
-| **Presentations**: PPTX, PPTM, POTX, PPSX · PPT, ODP, OTP, FODP, Keynote² | PDF, PNG, JPG, DOCX, HWPX · OTP² |
+| **Presentations**: PPTX, PPTM, POTX, POTM, PPSX · PPT, ODP, OTP, FODP, Keynote² | PDF, PNG, JPG, DOCX, HWPX · OTP² |
| **HWP**: HWP, HWPX | PDF, PNG, DOCX, HWPX ↔ HWP, TXT, Markdown, HTML |
| **Text**: TXT, Markdown, HTML; MHTML (saved web pages) read · reStructuredText, LaTeX, Org, AsciiDoc, Typst, MediaWiki, DocBook, Jupyter, Textile, man, OPML³ | PDF, DOCX, HWPX, EPUB · each other, PPTX slides³ |
| **E-books**: EPUB, KEPUB, MOBI, AZW3, AZW, AZW4, FB2, CBZ, CBR, CB7, HTMLZ, TXTZ · LIT, LRF, CHM, PDB, …⁴ | PDF, EPUB, KEPUB (Kobo), DOCX, TXT, HTML, HWPX · MOBI, AZW3⁴ |
diff --git a/README.zh-CN.md b/README.zh-CN.md
index ab428d2b..0b286be2 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -34,7 +34,7 @@
<table>
<tr>
<td width="33%" valign="top"><b>就在光标旁</b><br>无需打开应用窗口。只显示适合当前拖动文件的格式,就在你所在的位置。</td>
- <td width="33%" valign="top"><b>247 种格式,无需其他软件</b><br>图片、PDF、Word、Excel、PowerPoint、HWP、电子书、压缩包、字体、CAD 和 3D 模型,无需 Office、韩文办公软件或 LibreOffice。</td>
+ <td width="33%" valign="top"><b>248 种格式,无需其他软件</b><br>图片、PDF、Word、Excel、PowerPoint、HWP、电子书、压缩包、字体、CAD 和 3D 模型,无需 Office、韩文办公软件或 LibreOffice。</td>
<td width="33%" valign="top"><b>只在你的电脑上</b><br>不上传任何文件。Filee 离线工作,结果保存在原文件旁边。</td>
</tr>
</table>
@@ -90,7 +90,7 @@
| **PDF** | DOCX、HWPX、TXT、PNG、JPG、TIFF、CBZ、PPTX(每页一张图片)、SVG²;合并、拆分、页码范围、压缩(更小的 PDF) |
| **文档**:DOCX、DOCM、DOTX、EML、Outlook MSG · DOC、ODT、FODT、OTT、RTF、WPS、WPD、Pages、ClarisWorks、MacWrite、T602 等² | PDF、DOCX、HWPX、EPUB、TXT、HTML、MSG → EML · ODT、FODT、OTT² |
| **表格**:XLSX、XLSM、XLS、XLT、ODS、CSV、TSV · OTS、FODS、Numbers、ET² | PDF、XLSX、ODS、CSV、TSV、JSON、HWPX、HTML · XLT、OTS² |
-| **演示文稿**:PPTX、PPTM、POTX、PPSX · PPT、ODP、OTP、FODP、Keynote² | PDF、PNG、JPG、DOCX、HWPX · OTP² |
+| **演示文稿**:PPTX、PPTM、POTX、POTM、PPSX · PPT、ODP、OTP、FODP、Keynote² | PDF、PNG、JPG、DOCX、HWPX · OTP² |
| **HWP**:HWP、HWPX | PDF、PNG、DOCX、HWPX ↔ HWP、TXT、Markdown、HTML |
| **文本**:TXT、Markdown、HTML;MHTML(保存的网页)仅读取 · reStructuredText、LaTeX、Org、AsciiDoc、Typst、MediaWiki、DocBook、Jupyter、Textile、man、OPML³ | PDF、DOCX、HWPX、EPUB · 互相转换、PPTX 幻灯片³ |
| **电子书**:EPUB、KEPUB、MOBI、AZW3、AZW、AZW4、FB2、CBZ、CBR、CB7、HTMLZ、TXTZ · LIT、LRF、CHM、PDB 等⁴ | PDF、EPUB、KEPUB(Kobo)、DOCX、TXT、HTML、HWPX · MOBI、AZW3⁴ |
diff --git a/docs/ENGINES.md b/docs/ENGINES.md
index d7cac7db..ca969cf3 100644
--- a/docs/ENGINES.md
+++ b/docs/ENGINES.md
@@ -14,9 +14,9 @@ Filee chooses engines automatically. Settings → *Engines* shows their status,
| Unhwp | built in (library) | HWP/HWPX → TXT, Markdown, HTML (pictures in a `<name>_files` folder next to the Markdown, embedded in the HTML) |
| Markdown (Markdig) | built in (library) | **Markdown → HTML, TXT** (and → PDF / DOCX through the HWPX writer, rhwp or LibreOffice) |
| Spreadsheets (ExcelDataReader for XLS) | built in (library) | **XLSX, XLS, ODS, CSV, TSV → XLSX, ODS, CSV, TSV** (one CSV / TSV per sheet) |
-| Office Open XML | built in | **DOCM / DOTX / DOTM ↔ DOCX, XLSM / XLTX ↔ XLSX, PPTM / POTX / PPSX ↔ PPTX** (macros removed for macro-free types) |
+| Office Open XML | built in | **DOCM / DOTX / DOTM ↔ DOCX, XLSM / XLTX ↔ XLSX, PPTM / POTX / POTM / PPSX ↔ PPTX** (macros removed for macro-free types) |
| Fonts | built in | **TTF, OTF, WOFF, WOFF2, EOT ↔ each other**; CFF (PostScript) outlines become TrueType for TTF and EOT |
-| **HWPX writer** | built in | **DOCX (+ DOCM/DOTX/DOTM), XLSX (+ XLSM/XLTX), XLS, ODS, CSV, TSV, PPTX (+ PPTM/POTX/PPSX), PDF, HTML, MHTML, EPUB, MOBI/AZW3, FB2, HWPX, TXT, Markdown → HWPX** (and with rhwp → PDF and images); ODT, RTF, reStructuredText, LaTeX → HWPX with Pandoc |
+| **HWPX writer** | built in | **DOCX (+ DOCM/DOTX/DOTM), XLSX (+ XLSM/XLTX), XLS, ODS, CSV, TSV, PPTX (+ PPTM/POTX/POTM/PPSX), PDF, HTML, MHTML, EPUB, MOBI/AZW3, FB2, HWPX, TXT, Markdown → HWPX** (and with rhwp → PDF and images); ODT, RTF, reStructuredText, LaTeX → HWPX with Pandoc |
| **DOCX writer** | built in | **HWPX (and HWP through rhwp), PDF, HTML, MHTML, EPUB, MOBI/AZW3, FB2, Markdown, TXT, XLSX, XLS, ODS, CSV, PPTX (+ variants) → DOCX** |
| PDF text | built in (PdfPig) | **PDF → TXT, Markdown** (reading order, also two columns; Markdown keeps headings, emphasis, links and the pictures; no OCR) |
| PDF slides | built in (PDFium, PdfPig) | **PDF → PPTX**: a picture of each page on its own slide (looks like the PDF, not editable), the page's text in the speaker notes |
@@ -281,7 +281,7 @@ Readers turn the source into a small document model (`Hwp/Hwpx/HwpxModel.cs`) an
- **TXT** needs no reader (one paragraph per line; UTF-8, UTF-16 or the Korean code page CP949).
- **Markdown** is parsed with Markdig (`MarkdownReader.cs`): headings, emphasis, code, lists (1. / a. / i. with
start numbers), task lists, quotes, tables with spans, links, images, footnotes and math. No Pandoc needed.
-- **PDF** is read with PdfPig (see *PDF reader* below); DOCM / DOTX / DOTM, XLSM / XLTX and PPTM / POTX / PPSX
+- **PDF** is read with PdfPig (see *PDF reader* below); DOCM / DOTX / DOTM, XLSM / XLTX and PPTM / POTX / POTM / PPSX
are read like DOCX, XLSX and PPTX.
- **HTML** is parsed with AngleSharp (`HtmlReader.cs`, `HtmlCss.cs`): headings, paragraphs, bold / italic /
underline / strike / sub / sup / code / mark, the basic inline CSS (colour, background, font weight, style and
diff --git a/src/Filee.Core/Formats/FormatRegistry.cs b/src/Filee.Core/Formats/FormatRegistry.cs
index c8105b60..0d3af0fb 100644
--- a/src/Filee.Core/Formats/FormatRegistry.cs
+++ b/src/Filee.Core/Formats/FormatRegistry.cs
@@ -119,6 +119,7 @@ public static class FormatRegistry
new("pptx", "PPTX", FormatCategory.Presentation, ["pptx"]),
new("pptm", "PPTM", FormatCategory.Presentation, ["pptm"]),
new("potx", "POTX", FormatCategory.Presentation, ["potx"]),
+ new("potm", "POTM", FormatCategory.Presentation, ["potm"]),
new("ppsx", "PPSX", FormatCategory.Presentation, ["ppsx"]),
new("ppt", "PPT", FormatCategory.Presentation, ["ppt", "pps", "pot"]),
new("odp", "ODP", FormatCategory.Presentation, ["odp"]),
diff --git a/src/Filee.Core/Settings/AppSettings.cs b/src/Filee.Core/Settings/AppSettings.cs
index 7ec34b1d..4b28a9fb 100644
--- a/src/Filee.Core/Settings/AppSettings.cs
+++ b/src/Filee.Core/Settings/AppSettings.cs
@@ -64,7 +64,7 @@ public sealed class DonutSettings
public sealed class AppSettings
{
/// <summary>Current schema version. Increase when the format changes and add a migration.</summary>
- public const int CurrentSchemaVersion = 23;
+ public const int CurrentSchemaVersion = 24;
public int SchemaVersion { get; set; } = CurrentSchemaVersion;
diff --git a/src/Filee.Core/Settings/UserDataStore.cs b/src/Filee.Core/Settings/UserDataStore.cs
index dc76cec6..17dea6ea 100644
--- a/src/Filee.Core/Settings/UserDataStore.cs
+++ b/src/Filee.Core/Settings/UserDataStore.cs
@@ -627,6 +627,10 @@ internal static class SettingsMigrations
// the user already takes them.
if (from < 23)
changed |= LearnExtensions(profiles, out _, ["mhtml", "mht"]);
+ // v24: macro-enabled PowerPoint templates (.potm) open from the presentation donut next to POTX, unless a donut
+ // of the user already takes them.
+ if (from < 24)
+ changed |= LearnExtensions(profiles, out _, ["potm"]);
return changed;
}
diff --git a/src/Filee.Engines/Hwp/Hwpx/DocumentReaders.cs b/src/Filee.Engines/Hwp/Hwpx/DocumentReaders.cs
index 2affa40b..1ab9c011 100644
--- a/src/Filee.Engines/Hwp/Hwpx/DocumentReaders.cs
+++ b/src/Filee.Engines/Hwp/Hwpx/DocumentReaders.cs
@@ -43,6 +43,7 @@ internal static class DocumentReaders
["pptx"] = PptxReader.Read,
["pptm"] = PptxReader.Read,
["potx"] = PptxReader.Read,
+ ["potm"] = PptxReader.Read,
["ppsx"] = PptxReader.Read,
["pdf"] = PdfDocumentReader.Read,
// HWP comes here as HWPX, converted by rhwp first (the route planner adds that step).
diff --git a/src/Filee.Engines/Hwp/Hwpx/HwpxConverter.cs b/src/Filee.Engines/Hwp/Hwpx/HwpxConverter.cs
index f908fdce..bf6f570e 100644
--- a/src/Filee.Engines/Hwp/Hwpx/HwpxConverter.cs
+++ b/src/Filee.Engines/Hwp/Hwpx/HwpxConverter.cs
@@ -4,7 +4,7 @@
// text boxes and formatting.
// * TXT needs no reader: one paragraph per line. Markdown is parsed with Markdig (MarkdownReader).
// * XLSX / XLSM / XLTX and CSV are read directly (Office/Sheets); every sheet becomes a table (SheetDocument).
-// * PPTX / PPTM / POTX / PPSX are read directly (Pptx/PptxReader): one page per slide.
+// * PPTX / PPTM / POTX / POTM / PPSX are read directly (Pptx/PptxReader): one page per slide.
// * PDF is read with PdfPig (Pdf/PdfDocumentReader): text in reading order, headings, ruled tables, pictures, scans
// as images.
// * HTML (HtmlReader, AngleSharp), EPUB, MOBI / AZW3, FB2, HTMLZ and TXTZ (Ebooks) and HWPX (HwpxReader) are read
diff --git a/src/Filee.Engines/Office/OoxmlConverter.cs b/src/Filee.Engines/Office/OoxmlConverter.cs
index 7676db97..3f746e9f 100644
--- a/src/Filee.Engines/Office/OoxmlConverter.cs
+++ b/src/Filee.Engines/Office/OoxmlConverter.cs
@@ -1,4 +1,4 @@
-// Office Open XML variants without Office: DOCM / DOTX / DOTM ↔ DOCX, XLSM / XLTX ↔ XLSX and PPTM / POTX / PPSX ↔ PPTX.
+// Office Open XML variants without Office: DOCM / DOTX / DOTM ↔ DOCX, XLSM / XLTX ↔ XLSX and PPTM / POTX / POTM / PPSX ↔ PPTX.
// A variant is the same package with another content type for its main part, so the package is copied with that type
// rewritten. Going to a macro-free type also drops the VBA project, its signatures and data, Word's key map
// customisations and Excel 4.0 macro sheets, with every relationship pointing to them (Office refuses a macro-free
@@ -32,6 +32,7 @@ public sealed class OoxmlConverter : IConverter
["pptx"] = ("powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml", false),
["pptm"] = ("powerpoint", "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml", true),
["potx"] = ("powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml", false),
+ ["potm"] = ("powerpoint", "application/vnd.ms-powerpoint.template.macroEnabled.main+xml", true),
["ppsx"] = ("powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml", false),
};
@@ -60,7 +61,7 @@ public sealed class OoxmlConverter : IConverter
select new ConversionEdge(source.Key, target.Key),
];
- public EngineStatus GetStatus() => EngineStatus.Available("DOCM, DOTX, DOTM ↔ DOCX; XLSM, XLTX ↔ XLSX; PPTM, POTX, PPSX ↔ PPTX", EngineVersions.BuiltIn);
+ public EngineStatus GetStatus() => EngineStatus.Available("DOCM, DOTX, DOTM ↔ DOCX; XLSM, XLTX ↔ XLSX; PPTM, POTX, POTM, PPSX ↔ PPTX", EngineVersions.BuiltIn);
public Task<IReadOnlyList<string>> ConvertAsync(ConversionStep step, IProgress<double>? progress, CancellationToken cancellationToken) =>
Task.Run<IReadOnlyList<string>>(() =>
diff --git a/tests/Filee.Core.Tests/UserDataStoreTests.cs b/tests/Filee.Core.Tests/UserDataStoreTests.cs
index 09a31904..fd83190a 100644
--- a/tests/Filee.Core.Tests/UserDataStoreTests.cs
+++ b/tests/Filee.Core.Tests/UserDataStoreTests.cs
@@ -601,6 +601,29 @@ public class UserDataStoreTests
Assert.Equal(["mhtml"], profiles.Single(p => p.Id == "text").Extensions.Where(e => e.StartsWith("mht", StringComparison.Ordinal)));
}
+ [Fact]
+ public void Version_23_libraries_learn_potm_on_the_presentation_donut_and_nothing_else()
+ {
+ // As written with schema 23: no POTM, and the user took ODP off the presentation donut.
+ var presets = BuiltInData.CreatePresets();
+ var profiles = BuiltInData.CreateProfiles();
+ var slides = profiles.Single(p => p.Id == "presentations");
+ slides.Extensions.RemoveAll(e => e is "potm" or "odp");
+
+ Assert.True(SettingsMigrations.ApplyToLibrary(23, presets, profiles));
+
+ Assert.Contains("potm", slides.Extensions);
+ Assert.DoesNotContain("odp", slides.Extensions);
+ Assert.False(SettingsMigrations.ApplyToLibrary(23, presets, profiles)); // once only
+
+ // A donut of the user that already opens .potm files keeps them.
+ profiles = BuiltInData.CreateProfiles();
+ profiles.Single(p => p.Id == "presentations").Extensions.Remove("potm");
+ profiles.Insert(0, new ToolbarProfile { Id = "templates", Name = "Templates", Extensions = ["potm"] });
+ Assert.False(SettingsMigrations.ApplyToLibrary(23, presets, profiles));
+ Assert.DoesNotContain("potm", profiles.Single(p => p.Id == "presentations").Extensions);
+ }
+
[Fact]
public void Version_15_libraries_get_the_tracing_presets_on_the_images_donut_after_pdf()
{
diff --git a/tests/Filee.Engines.Tests/OoxmlVariantTests.cs b/tests/Filee.Engines.Tests/OoxmlVariantTests.cs
index 862b48b5..e63ba10c 100644
--- a/tests/Filee.Engines.Tests/OoxmlVariantTests.cs
+++ b/tests/Filee.Engines.Tests/OoxmlVariantTests.cs
@@ -114,11 +114,11 @@ public class OoxmlVariantTests(EngineFixture fx) : IClassFixture<EngineFixture>
public void Variants_are_converted_by_the_ooxml_engine_and_read_directly()
{
var planner = fx.Catalog.CreatePlanner();
- foreach (var (from, to) in new[] { ("docm", "docx"), ("dotx", "docx"), ("docx", "dotm"), ("xlsm", "xlsx"), ("xlsx", "xltx"), ("pptm", "pptx"), ("potx", "pptx"), ("ppsx", "pptx"), ("pptx", "ppsx") })
+ foreach (var (from, to) in new[] { ("docm", "docx"), ("dotx", "docx"), ("docx", "dotm"), ("xlsm", "xlsx"), ("xlsx", "xltx"), ("pptm", "pptx"), ("potx", "pptx"), ("potm", "pptx"), ("pptm", "potm"), ("ppsx", "pptx"), ("pptx", "ppsx") })
Assert.Equal("ooxml", Assert.Single(planner.Plan(from, to)!.Steps).Converter.Id);
// Families never mix.
Assert.DoesNotContain(fx.Converters.Single(c => c.Id == "ooxml").Edges, e => OoxmlConverter.Variants[e.From].Family != OoxmlConverter.Variants[e.To].Family);
- foreach (var from in new[] { "docm", "dotx", "dotm", "xlsm", "xltx", "pptm", "potx", "ppsx" })
+ foreach (var from in new[] { "docm", "dotx", "dotm", "xlsm", "xltx", "pptm", "potx", "potm", "ppsx" })
Assert.Equal("hwpx-writer", Assert.Single(planner.Plan(from, "hwpx")!.Steps).Converter.Id);
Assert.Equal("spreadsheet", Assert.Single(planner.Plan("xlsm", "csv")!.Steps).Converter.Id);
Assert.Equal("spreadsheet", Assert.Single(planner.Plan("xltx", "csv")!.Steps).Converter.Id);
@@ -223,4 +223,31 @@ public class OoxmlVariantTests(EngineFixture fx) : IClassFixture<EngineFixture>
var docx = await ConvertAsync(ppsx, "docx");
DocxAssert.ValidPackage(docx);
}
+
+ [Fact]
+ public async Task Macro_enabled_templates_keep_macros_only_where_allowed()
+ {
+ var dir = fx.NewFolder();
+ var pptx = new PptxBuilder();
+ pptx.Slide(pptx.Title("매크로 서식"));
+ var source = pptx.Save(Path.Combine(dir, "서식.pptx"));
+ var pptm = AddMacros(source, "pptm", dir);
+ File.Delete(source);
+
+ var potm = await ConvertAsync(pptm, "potm");
+ Assert.Equal(".potm", Path.GetExtension(potm));
+ using (var template = PresentationDocument.Open(potm, false))
+ Assert.Equal(PresentationDocumentType.MacroEnabledTemplate, template.DocumentType);
+ using (var zip = ZipFile.OpenRead(potm))
+ Assert.NotNull(zip.GetEntry("ppt/vbaProject.bin"));
+
+ File.Delete(pptm);
+ var fromTemplate = await ConvertAsync(potm, "pptx");
+ AssertNoMacros(fromTemplate);
+ using (var presentation = PresentationDocument.Open(fromTemplate, false))
+ Assert.Equal(PresentationDocumentType.Presentation, presentation.DocumentType);
+
+ DocxAssert.ValidPackage(await ConvertAsync(potm, "docx"));
+ HwpxAssert.ValidPackage(await ConvertAsync(potm, "hwpx"));
+ }
}