We are upgrading to FOP 0.94 from 0.20.5 (on Java 1.5). I am new to java
printing in general, so any help in pointing me to the solution is greatly
appreciated.
My goal is to print directly to a printer from my java program (I have
already generated an FO document) with printer parameters that have already
been set up (so no user interaction for this process).
We had the following code working in FOP 0.20.5:
/**
* Renders and prints a source XSL-FO document to specified print job
*/
public static void print(InputSource source, DocPrintJob job,
PrintRequestAttributeSet pras)
throws AjentException {
if (job != null) {
AWTRenderer renderer = new AWTRenderer(null);
render(source, renderer);
try {
Doc doc = new SimpleDoc(renderer,
DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
job.print(doc, pras);
} catch (PrintException e) {
...
}
}
}
/**
* Render a source XSL-FO document using specified renderer
*/
public static void render(InputSource source, Renderer renderer) throws
AjentException {
Driver driver = new Driver();
driver.setInputSource(source);
driver.setRenderer(renderer);
try {
driver.run();
} catch (IOException e) {
…
} catch (FOPException e) {
...
}
}
I want to do something similar in 0.94 (directly print with my settings). I
have looked at the ExampleFO2OldStylePrint example on the FOP site, however,
I cannot figure out how to set the printer properties that I was setting
before. (Printer and printer tray are the main properties).
I realize that I will be complete changing this for 0.94, however, an
example of setting printer options to print directly in the new API would be
greatly appreciated.
Thanks for any help or direction on this.
David J
Columbia Ultimate
--
View this message in context:
http://www.nabble.com/Direct-Printing-and-setting-print-parameters-in-FOP-0.94-tp16747594p16747594.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]