I just set up FOP to run from ASP/VBScript, using WScript.Shell...
Unfortunately, it's non-trivial if you want to monitor FOP's output to
know if it succeeds or fails. I can talk about that if anyone's
interested but it'll get long...
However, to simply use the Run method to blindly run FOP, it shouldn't be
so bad... (disclaimer: untested code)
' Execute FOP to render a PDF. We execute it via a command-line
' interface provided via the Windows Scripting Host.
Set Shell = Server.CreateObject("WScript.Shell")
Shell.CurrentDirectory = FOPDirectory ' Full path to where you put it...
' Now we have to generate a command line which will take our raw XML,
' process it with our template, and produce a PDF in the proper location.
commandline = "fop.bat"
commandline = commandline & " -xml " & XMLFilename ' Set vars accordingly...
commandline = commandline & " -xsl " & XSLFilename
commandline = commandline & " -pdf " & PDFFilename
' Now we have our command line. Let's execute it.
ResultCode = Shell.Run(commandline,,True) ' True = Wait for FOP to finish
BTW, I'd suggest upgrading to the newest version of MS Scripting if you
On Thu, 28 Feb 2002 [EMAIL PROTECTED] wrote:
> > I'm using FOP in a Windows environment and I want if possible to be able
> > to process a large batch of .fo files using a script. The easiest way for
> > me to do this is to use FOP as a COM object.
> > Can I do this?
> > So far I've tried:
> > - including the path to fop.jar in my classpath variable
> > - using javareg.exe to register org.apache.fop.apps.Driver as
> > fop.apps.Driver
> > - creating a new ActiveXObject "fop.apps.Driver"
> > but object isn't created.
> > Your help is much appreciated.
> > Tom