Jeff,

I'm in the same boat as you. However, I have worked out a way of using FOP
that doesn't require the use of batch files, environment variables and all
that other messy stuff that Windows developers left behind ages ago. What I
do is build a command line to java.exe that specifes everything that FOP
needs to know. It looks like this:

d:\jdk\bin\java.exe -cp
d:\jdk\lib\tools.jar;d:\jdk\lib\classes.zip;d:\fopv20\fop.jar;d:\fopv20\lib\
batik.jar;d:\fopv20\lib\xalan-2.0.0.jar;d:\fopv20\lib\xerces-1.2.3.jar;d:\fo
pv20\lib\jimi-1.0.jar -jar d:\fopv20\fop.jar -fo
d:\dev\common\fop\racebook.fo -pdf d:\dev\common\fop\racebook.pdf

I build this dynamically in a COM component by passing in the name of the
input (d:\dev\common\fop\racebook.fo) and output
(d:\dev\common\fop\racebook.pdf) files, which are the only things that
change. I keep the paths to the Java exe and the FOP libaries in the
registry (arguably no better than an environment variable...) so that I can
maintain the same code on different machines. The -cp switch eliminates the
need for a classpath environment variable.

All of this I throw at a CreateProcessA WIN32 API call, using
CREATE_NO_WINDOW to prevent a window popping up on my server.

The downside to this approach is that a new Java.exe is spawned every time I
want to do a conversion from FO to PDF. Some people draw in breath sharply
at this, but I find that the overhead of this is negligible compared to the
time it takes to render a PDF. The upside is that it allows you do render
your PDF asynchronously, so you don't have to hang around for FOP to do it's
stuff.

If you, or anyone else, would like to see the code I use to do this, I'm
happy to share. But keep in mind that it's all VB, which may scare some
people away.

Cheers.

-----Original Message-----
From: Langdon, Jeffrey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 9 October 2001 12:59 
To: [EMAIL PROTECTED]
Subject: Jar Files


Matt:
 
I have spent the last three years learning XML/XSL/XPath and the like.
Since I work almost exclusively with Microsoft technologies - I crossed
over to the dark side :) - I have never had the need to learn Java.   It
seems all the formatters for FO are written in Java, so I can't jump
into the fray with FO as I have with other XML languages. I appreciate
your help, but I am still a little lost.  I understand the command line
prompt calling FOP, but I may have to wait for another windows program
that will help with the testing and debugging process.
 
Thanks again,
 
Jeff Langdon 
 
-----Original Message-----
From: Savino, Matt C [ mailto:[EMAIL PROTECTED]] 
Sent: Monday, October 08, 2001 6:27 PM
To: Langdon, Jeffrey
Subject: RE: Jar Files
 
Jeffrey, you may find using FOP a little rough going with no experience
in Java. I guess you could get by just using it as a stand-alone app.
Here is a batch file I use to set the classpath, compile a FOP embedded
program, and run that program. I prefer setting the classpath explicitly
like this rather than relying on a pre-set system classpath. The system
classpath can get out of hand pretty quick, and this way makes sure
nothing unwanted sneaks in. You may have been looking at some old docs,
because I don't think you need w3c anymore.
 
<<<>>>
set LIBDIR=D:\Downloads\Fop\092601-cvs\xml-fop\lib
 
set
classpath=.;%LIBDIR%\..\build\fop.jar;%LIBDIR%\batik.jar;%LIBDIR%\xalan-
2.0.
0.jar;%LIBDIR%\xerces-1.2.3.jar;%LIBDIR%\avalon-framework-4.0.jar;%LIBDI
R%\l
ogkit-1.0b4.jar;%LIBDIR%\jimi-1.0.jar;C:\bea\wlserver6.1\lib\weblogic.ja
r;%J
AVA_HOME%\lib\tools.jar
 
javac -verbose FOtoPDF.java
 
java FOtoPDF
<<<>>>
 
Note: you'll also need (your Java Home)/bin in your PATH environment
variable.
 
Good luck,
Matt
 
> -----Original Message-----
> From: Langdon, Jeffrey [ mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 08, 2001 12:41 PM
> To: [EMAIL PROTECTED]
> Subject: Jar Files
> 
> 
> Hello:
>  
> I just downloaded Fop-0.20.2.  I have read that I need to set
> the class
> path for the following: fop.jar, xerces.jar and w3c.jar.  I found
> fop.jar in the "build" folder, and a .jar called xerces-1.2.3 in the
> "lib" folder, but I can't find the w3c.jar.  I have no experience with
> Java, so I am a little confused about how to set up FOP and the class
> path.  After scanning through two XML/XSL books and the FOP web site -
> http://xml.apache.org/ - I am no closer to a solution.
>  
> Could someone point me in the right direction?
>  
> TIA,
>  
> Jeff Langdon
>  
> 
> 
> **********************************************************************
> This email and any files transmitted with it are confidential and 
> intended solely for the use of the individual or entity to whom they 
> are addressed. If you have received this email in error please notify 
> the system manager.
> 
> This footnote also confirms that this email message has been swept by 
> MIMEsweeper for the presence of computer viruses.
> 
> www.mimesweeper.com
> **********************************************************************
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> 
 
 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

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

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

Reply via email to