Hello
I have an application, which has to write PDF files using java.awt.print.Printable and which works fine on Windows clients.
Now I want to do the same on Macintosh, but I just get a dialog with "Keine Druckdienste gefunden", which means "No printservices available".
The class looks like this
public class Fax2 implements Printable
{
...
@Override
public int print(Graphics g, PageFormat pf, int pi)
throws PrinterException
{
Graphics2D g2 = (Graphics2D) g;
g2.drawLine(175, 170, 600, 170);
...
}
}
and it gets called like this
Fax2 fax = new Fax2();
PrinterJob printjob = PrinterJob.getPrinterJob();
printjob.setPrintable(fax);
try
{
HashPrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();
attr.add(OrientationRequested.LANDSCAPE);
boolean printAccepted = printjob.printDialog(attr);
if (printAccepted)
printjob.print(attr);
}
catch(PrinterException e)
{
e.printStackTrace();
}
Kind regards,
Chang