1

I need to know the answer of those questions, concerning Epson printers :

  1. Can I use Javafx print API to print to an EPSON printer ? or should I use the JavaPOS API ?

  2. How do I print Images to that printer ?

  3. How to setup page size ?

I have Epson TM-20II printer.

abd3lraouf
  • 1,438
  • 1
  • 18
  • 24

2 Answers2

1

Use JasperViewerFX, which is full featured JasperReport viewer written completely in JavaFx.

Shekhar Rai
  • 2,008
  • 2
  • 22
  • 25
  • How this can print to epson printers ? – abd3lraouf Jul 28 '16 at 18:54
  • You have to download and attach that project in your project. And import documents or you can also modify the code as your need. – Shekhar Rai Jul 29 '16 at 03:16
  • Thanks for your response. I know how to use and import libraries into my project. I think my questions are straightforward, you didn't show how your answer relate to my problem. – abd3lraouf Jul 29 '16 at 07:35
  • Sorry for the gap of communication. I think the type of printer doesn't matter for printing with javafx api or some other type of api. I have worked on printing system with javafx and also worked on simple jasperreport reporting system. I found `JasperReport` is very useful for report generating and documentation so i have suggested jasperviewerfx for the javafx version of jasperreport. – Shekhar Rai Jul 31 '16 at 02:29
  • No problem for communication, So you say that the JavaFX print API doesn't differ printers. I'll try that, soon I'm going to try programming using that printer. – abd3lraouf Jul 31 '16 at 07:31
  • Thanks for your suggestion to using `JasperReport` I'll try it if I needed it. but till now, it seems to be not needed, Thanks again for you suggestion. – abd3lraouf Jul 31 '16 at 07:33
0

After some research and experience with an epson printer (the model in the question)

Can I use Javafx print API to print to an EPSON printer ? or should I use the JavaPOS API ? How do I print Images to that printer ? Any document can be printed using that printer whatever api is used.

Of course. A print api and the one existing in JavaFX can be used to print to that printer.

How to setup page size ?

A page can be created using a helper method, embedded into JavaFx api, as follows :

PrintHelper.createPaper("PapperName", width, height, Units.MM);

width -> int

height -> int

abd3lraouf
  • 1,438
  • 1
  • 18
  • 24