Jump to content
Changes to the Jaspersoft community edition download ×

speedup the printing process in dot matrix printer


Recommended Posts

Dear All,


I want to print my jasper report using Epson dot matrix printer. Actually it is printing properly. But i want to print it with same performance in MS DOS based printing.


So pls help me to setting up the content of data to text based printing.


if there any sample code , highly appiciated.


Thanks in advanced.



Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Try to use for print testing this code.


private void printFile(PrintService vprintService, String vFileName) throws

Exception {

PrintService printService = (vprintService == null) ? PrintServiceLookup.lookupDefaultPrintService() : vprintService;


DocFlavor docFlavor = DocFlavor.INPUT_STREAM.AUTOSENSE;


DocAttributeSet docAttributes = new HashDocAttributeSet();



PrintRequestAttributeSet printRequestAttributes = new HashPrintRequestAttributeSet();

printRequestAttributes.add(new Copies(2));

try {

Doc doc = new SimpleDoc(new FileInputStream(vFileName), docFlavor,



DocPrintJob printJob = printService.createPrintJob();

printJob.print(doc, printRequestAttributes);

Attribute[] pas = printJob.getAttributes().toArray();

for(int i = 0, u = pas.length; i < u; i++){

//PrintRequestAttribute attr = (PrintRequestAttribute)pas;



} catch (FileNotFoundException ex) {

throw new Exception(ex.toString());

} catch (PrintException ex) {

throw new Exception(ex.toString());




Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...