Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

133
Visualizações
Printing to text printer using html/javascript through browser

We have desktop java swing application which can print some content to a text printer lpt1

try {
      FileWriter out = new FileWriter("lpt1");
      out.write("Hello world");
      out.write(0x0D); // CR
      out.close();
}

Now we have a web version of the same program to run on google chrome which is written in javascript/html/react. Because of browser limitations (security) we can not implement same mechanism. HTML5 File api is not enough for a such task I think. (10 years before it would be probably possible using ActiveX controls)

How can we trigger printing a text document to text printer where the client machine has a printer and a chrome browser is running? I have some possibilites/alternatives, any suggestions are appreciated.

1- Build a native java jar file, which encapculates and wraps a webview (an html renderer), run the html based version in the webview and if native operations such as file needed, communicate with the wrapper jar file and implement file operations as before.

2- Run the web based app, and demand the clients that they run a native jar file at the same time and the jar file opens some sockets etc and listens for localhost. The web application communicates with post requests to the local jar file.

3- Write a chrome plugin or extension which can handle java native file operations? Is it possible? Where can I start?

Note: It is enough for us that the web page runs on chrome only, we can also force to latest chrome builds. Cross browser support or support to old browsers is NOT needed.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda