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

371
Visualizações
Render docx in React js

I would like to properly render a docx file in React JS with the correct formatting, as it would appear in Word or a similar service. Currently, when displaying the text, all formatting is removed and appears as plain text. I obtain the file from the server, and process it, by:

const url = "http://localhost:8080/files/aboutme.docx";

axios.get(url, {
  responseType: 'arraybuffer',
}).then(response => {
  var doc = new Docxtemplater(new PizZip(response.data), {
    delimiters: {
      start: 'ran',
      end: 'ran'
    }
  });
  var text = doc.getFullText();
  setAboutMe(text);
})

I am using the Docxtemplater and PizZip libraries.

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Docxtemplater is

a library to generate docx/pptx documents from a docx/pptx template

If you need to render a docx file I think you should use react-doc-viewer. Then you could write something like:

import DocViewer from "react-doc-viewer";

function App() {
  const doc = [{ uri: "http://localhost:8080/files/aboutme.docx" }];

  return <DocViewer documents={doc} />;
} 
about 4 years ago · Santiago Trujillo Relatório
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