-->

JavaFX and printing to Epson printer

2019-09-11 07:08发布

问题:

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.

回答1:

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



回答2:

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