Archiv der Kategorie ‘JRuby‘

Accessing the Java Printing API using JRuby

Monday, den 5. April 2010

If you ever have to print a document from a Ruby app you might want to consider using JRuby to access the Java Printing API.Here is a small example accessing the API, looking up the printers and printing out their names to the console:

require ‘java’
flavor = javax.print.DocFlavor::INPUT_STREAM::TEXT_PLAIN_HOST

aset = javax.print.attribute.HashPrintRequestAttributeSet.new
aset.add(javax.print.attribute.standard.MediaSizeName::ISO_A4)
aset.add(javax.print.attribute.standard.Copies.new(1))

services = javax.print.PrintServiceLookup.lookupPrintServices(flavor, aset);

puts(”Anzahl der Drucker: ” + […]

RuPy 2009 - Ruby/Python conference in Poznan Poland sum up

Friday, den 20. November 2009

The RuPy conference 2009 was really a great event. I was totally excited how a polish technology conference will look like and I was impressed how the organiziers cared about everything. Among others Jakub P. Nowak, Katarzyna Bylec and Adam Parchimowicz helped with any open questions. They organized a hotel room as well as the […]