Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda