0

I have built several PDF documents dynamically from ASP.NET pages (HTML/CSS) using plugins like Winnovative HtmlToPDFconverter. It has always been a successful outcome using the built-in functionality for those plugins, like merging existing PDF documents with dynamic content and adding pre-defined headers and footers, adding page margins, page numbers and so forth. The HTML content has overall been rendered as expected in the final PDF document(s).

Is there any way/any advice for a similar .NET plugin that can render HTML/CSHTML to a Microsoft Word document (.docx) in the same way – or is it too difficult to render native HTML5 and CSS into a desirable layout for a Microsoft Word Document?

I have googled around and found some suggestions, but I'm looking for recommendations for maybe a specific plugin – or a warning if it is a no-go and too difficult to get the desired layout 1:1 from HTML to a Word document because of incompatibility between markups?

YowE3K
  • 23,852
  • 7
  • 26
  • 40
micknt
  • 297
  • 1
  • 8
  • 23
  • HTML is not intended to be converted to a Word document. You're better off using a library that creates a .docx file natively, such as [DocX](https://github.com/xceedsoftware/DocX) or [Open XML SDK](https://github.com/OfficeDev/Open-XML-SDK). – mason Jan 18 '18 at 02:24
  • Thank you mason - that's the clarification of the subject that I was looking for. Can I mark this as an answer? – micknt Jan 18 '18 at 23:30

1 Answers1

0

Devexpress HTML editor can export its HTML content to different formats including docx and rtf. Not sure about its limitations (e.g. script and canvas export, etc.), but in the common case it works well.

Vladimir
  • 828
  • 6
  • 8
  • Thank you Vladimir, I will check it out and see if the features can match the PDF plugins.. – micknt Jan 18 '18 at 23:32