You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Ro...@VerizonWireless.com on 2004/02/16 17:42:14 UTC
running "FOP -xml 1.xml -xsl 2.xsl -print" programmatically
Hi all, in order to do a batch print of pdf files that
are on my customers local pc, I would like to run
the equivalent of
"FOP -xml 1.xml -xsl 2.xsl -print"
programmatically, is there another way than resorting to a
Runtime.getRuntime().exec("..")
this is what I am thinking I have to do, but would prefer to
do this from java without using runtime.exec
=========================================
String printPdfCmd = "FOP -xml 1.xml -xsl 2.xsl -print";
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec(printPdfCmd);
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
RE: running "FOP -xml 1.xml -xsl 2.xsl -print" programmatically
Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Glen Mazza [mailto:grm7793@yahoo.com]
> >
> I didn't see that as an option, because he wanted the PDF output
> option. Print uses AWT and has different results.
>
Argh! Didn't read far enough to get that one... absolutely correct in that
case.
Cheers,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: running "FOP -xml 1.xml -xsl 2.xsl -print" programmatically
Posted by Glen Mazza <gr...@yahoo.com>.
Andreas L. Delmelle wrote:
>Say, I was about to point Robert there too, but first wanted to check a bit
>more on how he would have to adapt the example for Print output...
>Do you know off the top of your head (correct expression?) whether he could
>just replace the setRenderer()? (I was under the impression that Print & AWT
>were the two exceptions in this case; might be mistaken)
>
>TIA
>
>Andreas
>
>
>
I didn't see that as an option, because he wanted the PDF output
option. Print uses AWT and has different results.
Glen
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
RE: running "FOP -xml 1.xml -xsl 2.xsl -print" programmatically
Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Glen Mazza [mailto:grm7793@yahoo.com]
>
>
> 2. Or, for a very simple Java program, click the "This example"
> link here:
> http://xml.apache.org/fop/embedding.html#ExampleXML2PDF
>
Say, I was about to point Robert there too, but first wanted to check a bit
more on how he would have to adapt the example for Print output...
Do you know off the top of your head (correct expression?) whether he could
just replace the setRenderer()? (I was under the impression that Print & AWT
were the two exceptions in this case; might be mistaken)
TIA
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: running "FOP -xml 1.xml -xsl 2.xsl -print" programmatically
Posted by Glen Mazza <gr...@yahoo.com>.
Two main options are:
1. Use the Apache Ant Task: (if you haven't yet learned Ant, it is
time very well spent to do so):
http://xml.apache.org/fop/anttask.html
2. Or, for a very simple Java program, click the "This example" link here:
http://xml.apache.org/fop/embedding.html#ExampleXML2PDF
I suspect, given your requirements, Apache Ant will prove the more
efficient for you.
Glen
Robert.Walker@VerizonWireless.com wrote:
>Hi all, in order to do a batch print of pdf files that
>are on my customers local pc, I would like to run
>the equivalent of
>
>"FOP -xml 1.xml -xsl 2.xsl -print"
>programmatically, is there another way than resorting to a
>Runtime.getRuntime().exec("..")
>
>this is what I am thinking I have to do, but would prefer to
>do this from java without using runtime.exec
>=========================================
>String printPdfCmd = "FOP -xml 1.xml -xsl 2.xsl -print";
>Runtime runtime = Runtime.getRuntime();
>Process proc = runtime.exec(printPdfCmd);
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: fop-user-help@xml.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: running "FOP -xml 1.xml -xsl 2.xsl -print" programmatically
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Robert.Walker@VerizonWireless.com wrote:
> Hi all, in order to do a batch print of pdf files that
> are on my customers local pc, I would like to run
> the equivalent of
>
> "FOP -xml 1.xml -xsl 2.xsl -print"
> programmatically, is there another way than resorting to a
> Runtime.getRuntime().exec("..")
>
> this is what I am thinking I have to do, but would prefer to
> do this from java without using runtime.exec
> =========================================
> String printPdfCmd = "FOP -xml 1.xml -xsl 2.xsl -print";
> Runtime runtime = Runtime.getRuntime();
> Process proc = runtime.exec(printPdfCmd);
You realize there is no PDF involved in this case? The print
renderer doesn't use PDF or whatever as an intermediate result,
it uses the Java AWT interface to print the formatted content.
If you want to use the print renderer, you have to create a
PrintRenderer object, set a variety of parameters and pass it
to the driver's setRenderer() method. The FopPrintServlet in
the distribution's example directory has all the details.
J.Pietschmann
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org