Net-Core-DocX-HTML-To-PDF-Converter icon indicating copy to clipboard operation
Net-Core-DocX-HTML-To-PDF-Converter copied to clipboard

The example program cannot convert html to a docx file

Open 22140505 opened this issue 4 years ago • 2 comments

I have Libreoffice installed and I can't find the ability to convert html to docx.

22140505 avatar Oct 30 '20 03:10 22140505

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.

arslanaybars avatar Mar 04 '21 19:03 arslanaybars

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.

gofal avatar Jul 13 '22 09:07 gofal