Tabris 1.4 Preview: Print Support

Tabris 1.4 Preview: Print Support

Many people can stick to consuming their content on digital screens, but there might be times when you want to have it on paper. Therefore, the upcoming Tabris 1.4 release will add native support for printing right from your mobile device.

A Tabris client makes use of its platform specific approach to printing, which means that printing feels as natural as expected. On iOS we use AirPrint to discover and print to any AirPrint compatible printer, whereas on Android we use the Android printing framework to support a wide variety of printers.

[ Interested in mobile app development in Java? Download the 30-day trial or check out Tabris technology overview. ]

Issuing a print job will open a native print dialog, where you can further configure printing options and confirm your print intent.

tabris-print

Printing in Tabris 1.4 will provide support for the following file formats:

  • PDF (incl. PDF/A)
  • Images (jpg, png)
    • More image formats might be supported depending on the platform

To start a print job, you obtain the Tabris Print service and issue a print command. The print job can be customized with several print options like color, quality or duplex. The following snippet provides a simple example for printing a PDF file from an url:

PrintOptions printOptions = new PrintOptions();
printOptions.setJobName( "annual-report" );
printOptions.setOutputType( OutputType.COLOR );

Print print = RWT.getClient().getService( Print.class );
print.print( "https://url.com/file.pdf", printOptions );

Printing is supported on all versions of iOS and on Android 4.4 (KitKat) and above.

Please Note: The feature described above is a preview of the upcoming Tabris 1.4 features. Tabris 1.4 will be available on June 26th 2014. If you want to try it out before the release just send us a quick request.