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

369
Views
Renderizar docx en React js

Me gustaría representar correctamente un archivo docx en React JS con el formato correcto, como aparecería en Word o un servicio similar. Actualmente, al mostrar el texto, se elimina todo el formato y aparece como texto sin formato. Obtengo el archivo del servidor y lo proceso mediante:

 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); })

Estoy usando las bibliotecas Docxtemplater y PizZip.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Docxtemplate es

una biblioteca para generar documentos docx/pptx a partir de una plantilla docx/pptx

Si necesita renderizar un archivo docx, creo que debería usar react-doc-viewer . Entonces podrías escribir algo como:

 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 Report
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!