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

306
Vistas
Can a text file be directly printed by the browser?

When I print a text file (i.e. with the .txt extension) via JavaScript with the print() function, the final result is a PDF file when opening the print popup. But I need the resulting file to be the TXT file and send it to print.

Is there any way to print the original txt file by the browser?

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

0

Certainly, but you need the correct printer driver

enter image description here

enter image description here

OK it may in very very limited cases be possible, but I suspect not the way you may require, A plain text file can be easily read and displayed by most browsers it is just like xml or html simply text after all.

The browser will require some means to copy the plain-text for saving and that in theory can be saved to a file or print device which in turn can be sent to a text printer, however they are very rare since most modern printers are graphical, thus require a printer driver to convert text into vectors or PDF or postscript text or any other printers own language.

NOTE: The browser cannot/should not execute code such as

Notepad /print MyTxt.txt "Generic / Text Only"

since that would breach cross origin security.

However it is simple to do that without a browser involved using runtime command line java-script in a console / batch file or gui like Iexplorer.

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