Hi
Thanks for your comments, I found the following is the code in PrintRenderer
Class of FOP
private void initializePrinterJob() throws IllegalArgumentException {
// read from command-line options
copies = getIntProperty("copies", 1);
startNumber = getIntProperty("start", 1) - 1;
endNumber = getIntProperty("end", -1);
String str = System.getProperty("even");
if (str != null) {
mode = Boolean.valueOf(str).booleanValue() ? EVEN : ODD;
}
printerJob = PrinterJob.getPrinterJob();
printerJob.setJobName("FOP Document");
printerJob.setCopies(copies);
if (System.getProperty("dialog") != null) {
if (!printerJob.printDialog()) {
throw new IllegalArgumentException(
"Printing cancelled by operator");
}
}
printerJob.setPageable(this);
}
It reads the start and end pages to print the specified pages. But not sure
of how to pass as argument.
On 2/21/07, Mukul Gandhi <[EMAIL PROTECTED]> wrote:
With FOP, you can just specify -print option, which sends the output
to printer. But you cannot control the printing options (like start,
and end pages) from FOP command line. I think the reason for this is;
start and end page options is a facility provided by the printer
driver. You cannot specify these options at an application level.
But I think, you should get a printer dialog box (an OS feature) with
-print FOP option, from where you can control start and end pages
(just guessing..).
Anybody might correct me, if I am wrong.
On 2/21/07, Ramakrishna <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am using Appache FOP 0.93 to create PDF output and print outs from
> XML and XLS-FO file. I am invoking the FOP through the provided
> FOB.bat file passing the command line arguements for xml file, xsl
> file and the -print option. I would like to know how to provide the
> "From Page" and "To Page" options to the FOP to print the specified
> number of pages.
> FOP.bat -xml Data.xml -xsl FO_Template.xsl -print
>
> how to specify the -Dstart=2 and -Dend=4
>
> The following statement does not work
> FOP.bat -xml Data.xml -xsl FO_Template.xsl -print -Dstart=2 -Dend=4
>
> Please provide inputs on this.
>
> Thanks,
> Ram
>
--
Regards,
Mukul Gandhi
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]