Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
How to generate a word document from an html file containing <video> and <audio>

I am making a google chrome extension that is like a notes editor. I am trying to add a feature where the user can download their notes as a word document (initially I tried pdf, after doing research I found that pdfs cannot render video and audio), and the notes can contain embedded html5 audio and video ( and ). I searched up how to generate a word document from html and I used the code I found, but audio and video are not being rendered. I did a lot of research and found nothing about this. My code for making the word document is below:

const preHtml = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:w='urn:schemas-microsoft-com:office:word' xmlns='http://www.w3.org/TR/REC-html40'><head><meta charset='utf-8'><title>NoteLab Notes</title></head><body>";
const postHtml = "</body></html>";
const html = preHtml + notes.innerHTML + postHtml;

const blob = new Blob(['\ufeff', html], {
    type: 'application/msword'
});

const url = 'data:application/vnd.ms-word;charset=utf-8,' + encodeURIComponent(html);

const filename = prompt("What should be the name of the file?") + '.doc'

const downloadLink = document.createElement("a");

document.body.appendChild(downloadLink);

if(navigator.msSaveOrOpenBlob ){
    navigator.msSaveOrOpenBlob(blob, filename);
}
else {
    downloadLink.href = url;

    downloadLink.download = filename;

    downloadLink.click();
}

document.body.removeChild(downloadLink);

How am I supposed to get video and audio rendered?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!