Amberg / DocxTemplater

DocxTemplater: C# library for generating DOCX documents with templates, supporting placeholders, loops, tables, Markdown/HTML, and image embedding. Ideal for document automation.
MIT License
16 stars 2 forks source link

Target to .NET Standard 2.0 #16

Open ivoryguard opened 5 months ago

ivoryguard commented 5 months ago

Hello.

I found that the target framework of the nuget package is for .NET6~8. If it is changed to .NET Standard 2.0 like SharpDocx (https://github.com/egonl/SharpDocx), it can be used much more widely.

Best regards.

Amberg commented 5 months ago

Hi

I've dropped the support for .NET Standard because ImageSharp (a dependency of DocxTemplater.Images) dropped the support for .NET Standard. (See Looks like 3.0 drops support for .NET Standard?)

I have just checked whether the base project would compile with netstandard2.0. Unfortunately this is not the case. But I think it should be possible. However, images in the templates would then not be supported.

When I get round to it, I will have another look. But PRs are very welcome :-)

ivoryguard commented 5 months ago

I think it's fine to use the older version of ImageSharp if it provides enough functionality, or to implement only what is required for image template functionality without using external dependencies like SharpDocx. (SharDocx does not have external dependency for image template.

In the real world, developing applications for .NET Framework is still sometimes a better choice than .NET (WPF as well as WinForm), especially since docx is highly associated with MS Word, which is highly associated with the Windows OS. So, supporting the .NET Framework will make this good library available to more people.

Or, It can be a way to support both .NET Framework and .NET6 like other some nuget packages.

Anyway these are just my thoughts. I am developing a WPF application with .NET Framework 4.8 because it needs to reference assemblies for the old .NET Framework, so I have no choice but to use SharpDocx for now.

However, I think from the perspective of someone creating templates, DocxTemplater using {{}} would be easier for non-developers.

Best regards.