ngs-doo / TemplaterExamples

Creating reports in .NET and Java
https://templater.info
The Unlicense
48 stars 27 forks source link

Include HTML in templater #46

Closed albertobelardi closed 2 years ago

albertobelardi commented 2 years ago

I developed a custom convert to allow an html from an external data source to be converted within the docx document managed by templater. Within my HTML are images encoded in Base64 format. The procedure is abuonly successful if the HTML contains no images. What can I use to include html in a templater tag? Thank you.

zapov commented 2 years ago

Here is example of how to pass file with html extension into Word: https://github.com/ngs-doo/TemplaterExamples/tree/master/Intermediate/HtmlToWord So you could create temporary file, pass it along, and then remove it at the end of procesing

albertobelardi commented 2 years ago

Ok thank you, when you use System.IO.FileInfo in C# the inject html text into document will be injected outside everything table, section and so on. Is possible to encapsulate the html text into a word table?

zapov commented 2 years ago

Not via that method. Only if you provide XML, but then you are rather limited in what you can paste.