Java API usage for Printer