Net-Core-DocX-HTML-To-PDF-Converter
Net-Core-DocX-HTML-To-PDF-Converter copied to clipboard
The example program cannot convert html to a docx file
I have Libreoffice installed and I can't find the ability to convert html to docx.
Hey folks, 👋
There is a bug while converting from html to docx 🥺.
I solved it by modified ConvertWithLibreOffice.cs. I just change 89 Line foreach (var arg in commandArgs) { procStartInfo.ArgumentList.Add(arg); }
to procStartInfo.Arguments = String.Join(" ", commandArgs);
Then it works for docx files as well. 🎉
@martinweihrauch I can create pr for this change. Thank you for this great library.
why should that fix html to docx conversion? your change is just about passing the commandargs to the process. The current method with Argumentlist.add
is more save in case you have parametes containing empty strings. dotnet then handles that for you. in your situation, where you build up the arguments string yourself, then you have to care about arguments that do have empty spaces yourself, then you have to wrap them into quotation marks.