Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update link to go to OpenMRS Add-ons index instead

Overview

Simple printing API. The module currently only provides an API to call and a method of choosing the default printer for OpenMRS. No additional functionality is included.

Setup

In your module you must indicate that the printing module is required. In config.xml put:

Code Block

<require_modules>
     <require_module>org.openmrs.module.printing</require_module>
</require_modules>

Example Usage

Code Block

Class printingServiceClass = getClass().getClassLoader().loadClass("org.openmrs.module.printing.PrintingService");
PrintingService printingService = (PrintingService)Context.getService(printingServiceClass);
ByteArrayOutputStream out = new ByteArrayOutputStream();

... write to 'out' ...

printingService.addPrintJob(out.toByteArray(), true /* interactive */ ));

interactive mode will pop up a java print dialog box that the user must click through to continue printing.

Download

Download Module

Developers

?Ben Wolfe