I have created a typescript script that takes in a JSON string and converts the information it contains into a sort of poster that is a Word Doc using Docx. There are some parts of the JSON that could have some html tags contained in it (not tables or css classes but it could be a <br/>, <i>, <p>, etc) and I want to be able to pass the string in and it return one of the DocX objects like a Paragraph or a TextRun.
I have found the package Html-to-Docx but from the look of the docs it wants to take one whole html string and return a file, whereas I want to be able to change and have more control over what goes in and is displayed in the WordDoc. I also dont want to have to change all my code over to a different library like OpenXML.
Is there another library/something I'm missing in DocX that could achieve this? Or would I have to parse my own strings to find where the <br/>, <i>, <p> tags are and try and parse them separately into DocX objects?
Any help would be appreciated, thanks
Converting HTML strings to DocX objects
206 views Asked by Badger8808 At
1
There are 1 answers
Related Questions in JAVASCRIPT
- Using Puppeteer to scrape a public API only when the data changes
- inline SVG text (js)
- An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
- Storing the preferred font-size in localStorage
- Simple movie API request not showing up in the console log
- Authenticate Flask rest API
- Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
- How to request administrator rights?
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- In Datatables, start value resets to 0, when column sorting
- How do I link two models in mongoose?
- parameter values only being sent to certain columns in google sheet?
- Run main several times of wasm in browser
- Variable inside a Variable, not updating
Related Questions in TYPESCRIPT
- It doesnt always show all the books on my homepage
- S3 integration testing
- Make some of the type's field optional
- storybook 7 does not recognize module declarations
- Page in React only renders elements after refreshing
- Error Inserting into Supabase: Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member
- vscode, debug angular, first time, doesn't debug, 2nd time stops at main.js then it's ok
- Get remote MKV file metadata using nodejs
- Vue/TailwindCSS - Content is behind Sidebar
- TypeScript Error only on big type only when assigned to a variable
- pnpm firebase app "Could not find a declaration file for module 'mime'"
- TypeScript: Type checking while parsing an arbitrary JSON that is typed/
- Issue with BBCode image tag on React
- Typescript: returnType based on value 'single' prop
- Failed to resolve import, but the path is valid, and detected as such by VSCode
Related Questions in MS-WORD
- VBA query - sort text in alphabetical order in Word
- Can you programmatically generate a link to open a Word document and navigate to a particular location within it (preferably a comment)?
- How can I create an automatic table of contents in docx without the text being bold?
- Does MS Word secretly upload my file to cloud?
- How to use VBA to bold just some text
- Find text and numbers Formatted: "Case: BE########" and format them, regardless of the number
- Access all documents for Word from multiple instance using Excel VBA
- Using document.Application.PixelsToPoints will give different results
- Error: "Document_KeyUp" event not working
- Word macro for reversing selected text
- Make a table of remarks/figures, and format it as a table
- Add custom ribbon button to dotm file that runs macro
- Inline pictures: Add margin
- Excel VBA: Action logging on label click (like Audit Trail)
- Custom referencing format in CSL document, Want to add whitespace into bibliography
Related Questions in DOCX
- How can I create an automatic table of contents in docx without the text being bold?
- Span figure across columns in Quarto docx output
- Convert .docx to pdf using XDocReport
- SvelteKit + docx – Can't read the data of 'the loaded zip file'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc)
- "IFDHandler is not defined" trying to import photos from Google Photos into a PDF generation app with NextJS
- Extract enum from Array with type restriction
- What is the newline character for Microsoft Word
- Can I add content stored in a const to addText() function in officegen-docx?
- APACHE POI: adding comment to existing word document
- How to save changes in Plain Text Content Control in docx file using python
- Export html to docx format and maintain all styles in javascript
- Apache POI - manipulating .doc lose images
- Convert Docx To Markdown With Specific Tables
- Package not found in Python docx
- WKWebview is not rendering .docx file accurately, docx contains logos in header and watermarks, which are not displayed
Related Questions in DOC
- APACHE POI: adding comment to existing word document
- Apache POI - manipulating .doc lose images
- Extract files embedded in doc files using python
- Multiple DOC files to be converted to ISOSTS XML files
- Delete all macros from docm files and convert it to docx
- Converting HTML strings to DocX objects
- Appscript required for populating my doc as pdf with images uploaded from google form
- Rest api doc hal explorer with Spring webflux not working
- How to generate changes between two javadoc versions
- python docx can't render img issue
- Add section above the copyright in the docusaurus.config.js file
- My file pathe is content://com.android.providers.media.documents/document/document%3A1000095307 but i can not convert base64 (pdf,doc,excel) in kotlin
- .doc file into .pdf using java
- I am trying to run docker on my port and i got this error below, How can I solve it?
- Export a doc or rtf file to a Chrome extension (React+Typescript)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I've created this basic html tag converter, it won't work for all use cases but if someone wants to add to it to include more tag support or improve the code they can, but this works for my use case