Luis Ferro in another thread (in response to your question) explained
about FOP -print option.

Here is what I investigated just now (and agree to Luis's comments) -
If you just type fop[.bat] on command line, various command line
options are listed. One of them is:
-print            input file will be rendered and sent to the printer
                   see options with "-print help"

Now when you type following on command line,
fop[.bat] -print help
following is displayed
USAGE: -print [-Dstart=i] [-Dend=i] [-Dcopies=i] [-Deven=true|false]
Example:
java -Dstart=1 -Dend=2 org.apache.Fop.apps.Fop infile.fo -print

This surely tells, that specifying various printing options from
command line is possible. But the example suggests, that options can
be set only with file of type .fo (this you need to investigate
further).

So your requirement that -print options should work with .xsl + .xml
files seems to be not working. I think you can write a wrapper .bat
file to suit your needs (if you want a 1 step process).

Or otherwise, you could perform printing of .fo file in a 2 step
manual process. i.e. in the first step use Xalan-J (bundled with FOP)
to transform .xsl + .xml into .fo file. And in the 2nd step, you can
print .fo file with the desired options.

I haven't tried -print option with FOP before. You can perhaps try
what I suggested, and see if it works for you.

On 2/22/07, Ramakrishna <[EMAIL PROTECTED]> wrote:

Hi

Thanks for your comments, I found the following is the code in PrintRenderer
Class of FOP


privatevoid 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


--
Regards,
Mukul Gandhi

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to