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

468
Vistas
How to Print a file using javascript

How to Print a file/files using javascript, the files are uploaded by the user and then need to be printed i can't find any methods there is printjs but supports on pdf.

Please Help me out

I tried printjs but only supports pdf and window.print method prints the webpage

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use .contentWindow.focus() and .contentWindow.print() to print file uploaded by user.

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

This site explained pretty well. You can check it out maybe you find it helpful.

enter image description here

about 4 years ago · Juan Pablo Isaza 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