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

372
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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