Jump to content
JasperReports 7.0 is now available ×

beldy

Members
  • Posts

    1
  • Joined

  • Last visited

beldy's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare

Recent Badges

0

Reputation

  1. Had the same issue. It looks like imageable are of thermal printer paper is not the same as paper size. This worked for me: // default jasper contextJasperReportsContext CTX = DefaultJasperReportsContext.getInstance();JasperPrint jp = ... // your filled jasper print objectPrintService ps = ... // your printerPrinterJob job = PrinterJob.getPrinterJob();job.setPrintService(ps);PageFormat fmt = job.getPageFormat(null);Paper p = fmt.getPaper();// set imageable area the size of whole printer paperp.setImageableArea(0, 0, p.getWidth(), p.getHeight());fmt.setPaper(p);switch (jp.getOrientationValue()) { case LANDSCAPE: fmt.setOrientation(PageFormat.LANDSCAPE); break; case PORTRAIT: fmt.setOrientation(PageFormat.PORTRAIT); break;}job.setPrintable(new JRPrinterAWT(CTX, jp), fmt);job.print();[/code]
×
×
  • Create New...