How to print the current notesdocument in java?

The following java code will change the printer to landscape and send an empty page to the printer,

I need to get a handle to the current document in notes and print it. please help !

PrinterJob printerJob = PrinterJob.getPrinterJob();

PageFormat pageFormat = printerJob.defaultPage();

pageFormat.setOrientation(PageFormat.LANDSCAPE);

//printerJob.pageDialog(pageFormat);

printerJob.print();

Thanks

Thomas

http://www.notessidan.se

Subject: How to print the current notesdocument in java ?

I’m not sure that you can print a NotesDocument from Java directly.

Printing is a UI kinda thing and there are no UI methods in the Domino Java API.

Frunobulax

Subject: How to print the current notesdocument in java ?

I Have one in Lotus Script and sure that we have similar classes in Java to use. This code will open the document in notes and prints it and close the document. This script Runs in Notes Client .

Set UIDoc = UiWS.EditDocument( False , )

Call UIDoc.Print( 1 )

Call UIDoc.Close(True)

In this Case , you need to enable the Printer property to be default and also the Landscape page property.

IF YOU ARE LOOKING TO PRINT THE NOTES DOCUMENT TO PDF DRIVER, PLEASE LET ME KNOW I HAVE A TOOL FOR THAT

HTH

Subject: How to print th current notesdocument in java ?

There is no way to temporary change the orientation using @formula or Lotusscript, this is why I need a java solution.

There are several sendkey solutions available for changing the current printer to landscape permanently, but i need to change it temporarily for a specific document.

Thanks

Thomas