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.
C# audio-converteravaloniabatch-conversionconvertercsharpdocument-converterdocx-to-pdfdotnetdrag-and-dropfile-conversionfile-converterheic-converterhwphwpximage-converterlinuxmacospdf-convertervideo-converterwindows
Put the conversions that go through another format on the donuts
KnifeLemon9e6deefd2bc9
diff --git a/src/Filee.Core/Presets/BuiltInData.cs b/src/Filee.Core/Presets/BuiltInData.csindex 5e81b976..63ce05af 100644--- a/src/Filee.Core/Presets/BuiltInData.cs+++ b/src/Filee.Core/Presets/BuiltInData.cs@@ -55,6 +55,7 @@ public static class BuiltInData},new() { Id = "to-docx", Name = "DOCX", TargetFormat = "docx" },new() { Id = "to-hwpx", Name = "HWPX", TargetFormat = "hwpx" },+ .. HwpPresets(),new() { Id = "to-odt", Name = "ODT", TargetFormat = "odt" },new() { Id = "to-rtf", Name = "RTF", TargetFormat = "rtf" },new() { Id = "to-txt", Name = "TXT", TargetFormat = "txt" },@@ -64,6 +65,12 @@ public static class BuiltInData.. CatalogPresets(),];+ /// <summary>HWP as a target, through HWPX (added in settings schema 7, see SettingsMigrations).</summary>+ public static List<Preset> HwpPresets() =>+ [+ new() { Id = "to-hwp", Name = "HWP", TargetFormat = "hwp" },+ ];+/// <summary>Spreadsheet targets (added in settings schema 5, see SettingsMigrations).</summary>public static List<Preset> SpreadsheetPresets() =>[@@ -160,13 +167,13 @@ public static class BuiltInData{Id = "pdf", NameKey = "profile.pdf",Extensions = ["pdf"],- PresetIds = ["to-png", "to-jpg", "to-docx", "to-txt", "to-epub", "to-hwpx", "to-tiff", "pdf-split", "merge-pdf"],+ PresetIds = ["to-png", "to-jpg", "to-docx", "to-txt", "to-md", "to-epub", "to-hwpx", "to-hwp", "to-tiff", "pdf-split", "merge-pdf"],},new(){Id = "office", NameKey = "profile.office",Extensions = ExtensionsOf(FormatCategory.Document),- PresetIds = ["to-pdf", "to-hwpx", "to-docx", "to-odt", "to-txt", "to-html", "to-epub", "merge-pdf"],+ PresetIds = ["to-pdf", "to-hwpx", "to-hwp", "to-docx", "to-odt", "to-txt", "to-html", "to-epub", "to-png", "merge-pdf"],},SpreadsheetProfile(),PresentationProfile(),@@ -174,7 +181,7 @@ public static class BuiltInData{Id = "hwp", NameKey = "profile.hwp",Extensions = ["hwp", "hwpx"],- PresetIds = ["to-pdf", "to-docx", "to-hwpx", "to-png", "to-txt", "to-md", "merge-pdf"],+ PresetIds = ["to-pdf", "to-docx", "to-hwpx", "to-hwp", "to-png", "to-jpg", "to-txt", "to-md", "to-epub", "merge-pdf"],},TextProfile(),.. CatalogProfiles(),@@ -191,7 +198,7 @@ public static class BuiltInDataId = "spreadsheets",NameKey = "profile.spreadsheets",Extensions = ExtensionsOf(FormatCategory.Spreadsheet),- PresetIds = ["to-pdf", "to-xlsx", "to-csv", "to-ods", "to-hwpx", "to-html", "merge-pdf"],+ PresetIds = ["to-pdf", "to-xlsx", "to-csv", "to-ods", "to-hwpx", "to-hwp", "to-html", "merge-pdf"],};/// <summary>PowerPoint and OpenDocument slides (split from "office" in settings schema 5).</summary>@@ -200,7 +207,7 @@ public static class BuiltInDataId = "presentations",NameKey = "profile.presentations",Extensions = ExtensionsOf(FormatCategory.Presentation),- PresetIds = ["to-pdf", "to-png", "to-jpg", "to-pptx", "to-hwpx", "merge-pdf"],+ PresetIds = ["to-pdf", "to-png", "to-jpg", "to-pptx", "to-hwpx", "to-hwp", "merge-pdf"],};/// <summary>Markdown, plain text and HTML (added in settings schema 4, see SettingsMigrations).</summary>@@ -209,7 +216,7 @@ public static class BuiltInDataId = "text",NameKey = "profile.text",Extensions = ExtensionsOf(FormatCategory.Text),- PresetIds = ["to-pdf", "to-hwpx", "to-docx", "to-html", "to-txt", "to-epub"],+ PresetIds = ["to-pdf", "to-hwpx", "to-hwp", "to-docx", "to-html", "to-txt", "to-epub"],};/// <summary>Donuts of the categories added in settings schema 6, in the order they follow "text".</summary>@@ -219,7 +226,7 @@ public static class BuiltInData{Id = "ebooks", NameKey = "profile.ebooks",Extensions = ExtensionsOf(FormatCategory.Ebook),- PresetIds = ["to-pdf", "to-epub", "to-docx", "to-txt", "to-azw3", "to-mobi", "to-hwpx", "to-html"],+ PresetIds = ["to-pdf", "to-epub", "to-docx", "to-txt", "to-azw3", "to-mobi", "to-hwpx", "to-hwp", "to-html"],},new(){diff --git a/src/Filee.Core/Settings/UserDataStore.cs b/src/Filee.Core/Settings/UserDataStore.csindex 43c195fc..867a9ee8 100644--- a/src/Filee.Core/Settings/UserDataStore.cs+++ b/src/Filee.Core/Settings/UserDataStore.cs@@ -314,9 +314,18 @@ internal static class SettingsMigrationsif (from < 6)changed |= AddCatalog(presets, profiles);- // v7: PDF → EPUB (PDF → DOCX → EPUB, built in) is on the PDF donut.+ // v7: conversions that already worked through another format but were on no donut. HWP as a target (through+ // HWPX), PDF → Markdown / EPUB (through DOCX), Word → PNG, HWP → JPG / EPUB (through PDF / DOCX).if (from < 7)- changed |= Offer(presets, profiles, "pdf", "to-epub", "to-txt");+ {+ foreach (var preset in BuiltInData.HwpPresets().Where(p => presets.All(existing => existing.Id != p.Id)))+ {+ presets.Add(preset);+ changed = true;+ }+ foreach (var (profile, preset, after) in Version7Offers)+ changed |= Offer(presets, profiles, profile, preset, after);+ }return changed;}@@ -361,6 +370,16 @@ internal static class SettingsMigrationsreturn changed;}+ /// <summary>Presets that settings schema 7 puts on the built-in donuts: (donut, preset, after which preset).</summary>+ private static readonly (string Profile, string Preset, string After)[] Version7Offers =+ [+ ("pdf", "to-md", "to-txt"), ("pdf", "to-epub", "to-md"), ("pdf", "to-hwp", "to-hwpx"),+ ("office", "to-hwp", "to-hwpx"), ("office", "to-png", "to-epub"),+ ("hwp", "to-hwp", "to-hwpx"), ("hwp", "to-jpg", "to-png"), ("hwp", "to-epub", "to-md"),+ ("spreadsheets", "to-hwp", "to-hwpx"), ("presentations", "to-hwp", "to-hwpx"),+ ("text", "to-hwp", "to-hwpx"), ("ebooks", "to-hwp", "to-hwpx"),+ ];+/// <summary>/// Puts a preset on a donut after <paramref name="after"/> (or at the end), unless the donut is missing, full or/// has it already. Returns true when it was added.diff --git a/tests/Filee.Core.Tests/UserDataStoreTests.cs b/tests/Filee.Core.Tests/UserDataStoreTests.csindex ae35709d..2806b6c5 100644--- a/tests/Filee.Core.Tests/UserDataStoreTests.cs+++ b/tests/Filee.Core.Tests/UserDataStoreTests.cs@@ -152,16 +152,24 @@ public class UserDataStoreTests}[Fact]- public void Version_6_libraries_get_epub_on_the_pdf_donut()+ public void Version_6_libraries_get_the_conversions_that_were_on_no_donut(){- // As written by 1.3.0: no EPUB on the PDF donut.+ // As written by 1.3.0: no HWP preset, and the donuts below without the targets 1.3.1 added.var presets = BuiltInData.CreatePresets();+ presets.RemoveAll(p => p.Id == "to-hwp");var profiles = BuiltInData.CreateProfiles();- profiles.Single(p => p.Id == "pdf").PresetIds.Remove("to-epub");+ foreach (var profile in profiles)+ profile.PresetIds.Remove("to-hwp");+ profiles.Single(p => p.Id == "pdf").PresetIds.RemoveAll(id => id is "to-md" or "to-epub");+ profiles.Single(p => p.Id == "office").PresetIds.Remove("to-png");+ profiles.Single(p => p.Id == "hwp").PresetIds.RemoveAll(id => id is "to-jpg" or "to-epub");Assert.True(SettingsMigrations.ApplyToLibrary(6, presets, profiles));- Assert.Equal(["to-png", "to-jpg", "to-docx", "to-txt", "to-epub"], profiles.Single(p => p.Id == "pdf").PresetIds.Take(5));+ // The same donuts as a new install.+ Assert.NotNull(presets.SingleOrDefault(p => p.Id == "to-hwp"));+ foreach (var expected in BuiltInData.CreateProfiles())+ Assert.Equal(expected.PresetIds, profiles.Single(p => p.Id == expected.Id).PresetIds);Assert.False(SettingsMigrations.ApplyToLibrary(6, presets, profiles)); // once only}