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

495
Views
Cómo imprimir un archivo usando javascript

Cómo imprimir un archivo/archivos usando javascript, los archivos son cargados por el usuario y luego deben imprimirse. No puedo encontrar ningún método, hay printjs pero es compatible con pdf.

Por favor, ayúdame

Probé printjs pero solo es compatible con pdf y el método window.print imprime la página web

over 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede usar .contentWindow.focus() y .contentWindow.print() para imprimir el archivo cargado por el usuario.

 <html> <head> <script> function print() { var frame = document.getElementById("frame"); frame.contentWindow.focus(); frame.contentWindow.print(); } </script> </head> <body> <iframe src="source_from_user_to_be_printed" id="frame" width="400" height="400"></iframe><br /> <button onclick="print()">Print PDF</button> </body> </html>

Este sitio explica bastante bien. Puedes echarle un vistazo, tal vez te resulte útil.

ingrese la descripción de la imagen aquí

over 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
Virtual assistant