Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

118
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda