Include HTML into a document #2441
Replies: 3 comments 2 replies
-
Not possible to add HTML into docx , sorry about this! How would this work? Would this transpile html into OOXML? I think it could be possible, but would require some work. Something to look into |
Beta Was this translation helpful? Give feedback.
-
Poor @dolanmiu having to reply to repeated requests for this over the years (I looked through all the issues for clues) ;) What about embedding docx XML? I've been fist fighting a similar situation where I'm building a docx where clips of HTML with basic elements are defined need to be mapped into a docx:
There are a couple of html to docx modules. htmlToDocx will return a full docx (zip compressed and all) and I tried to create a new Document from it, then get the content from it and append to the new document. I'm getting desperate so forgive me if this seems stupidly heavy. The goal of course is to just convert the document xml, not the styles, meta and packaging. Is there a way to even insert RAW docx XML section into a docx document? e.g. if I was able to convert to something that could be inserted into a normal document.xml |
Beta Was this translation helpful? Give feedback.
-
What about altChunk? How can we insert RAW docx XML into a section or paragraph? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I was working on a project with the library and I needed to include HTML from a rich text editor that gave me HTML code. However, we can't just put raw HTML code into a Paragraph to automatically format the code into the docx document.
Is it possible to add a function or a class that takes HTML code as a parameter? Maybe a class that extends the Paragraph class. In fact, there's an example with the .NET library named html2openxml that does what I mean if it's not clear...
I've already done something by myself to format HTML code for the moment, but I'm not very convinced by what I did.
Beta Was this translation helpful? Give feedback.
All reactions