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
¿Qué debo hacer para imprimir tipos de datos Blob (PDF) recuperados de un servidor web en Node?

No entiendo cómo manejar Blob-Files. Tengo una aplicación Electron donde recupero un pdf de un servidor web. Quiero imprimir silenciosamente el pdf recuperado del servidor web usando el nombre de la impresora almacenado en la printer . Probé diferentes soluciones, incluidos diferentes módulos de nodo, pero no funciona y no sé qué hacer. ¡Apreciaría tu ayuda!

 axios.get("getPdf", {responseType: "blob",headers: {'Accept': 'application/pdf'}).then(res => { let printer = printer_settings["printFormatX"]; // I am not quite sure what to do now // I used different modules like 'pdf-to-printer' but it is not working like expected // I am generally unsure what to do with the retrieved pdf in order to print it })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Lo resolví de esta manera: creo un archivo temporal, luego escribo los datos de respuesta para luego imprimirlo con el módulo pdf-to-printer

 axios.get("getPdf", {responseType: "arraybuffer",headers: {'Accept': 'application/pdf'}).then(res => { let printer = printer_settings["printFormatX"]; let tmpFile = __dirname + "/tmp_pdf.pdf" fs.writeFileSync(tmpFile, res.data, {encoding: "binary"}); print(tmpFile, res.data, {printer: printer}); })
about 4 years ago · Juan Pablo Isaza 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!