rockiroads
asked on
FOP with NetBeans
Righty ho, let me make it clear first. Im a newbie in Java. Ive crosstraining from C++, so you gotta bear with me if u go into pure java and I aint got a clue what you talking about :)
Im using NetBeans v5.5 and Ive downloaded FOP 0.9.3
I am trying to create a simple example of creating a pdf
Within NetBeans project, I added all the JARs in the lib folder of FOP
Here is a snippet of my code
//Java
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
//SAX
import org.xml.sax.InputSource;
//Avalon
import org.apache.avalon.framewor k.Exceptio nUtil;
import org.apache.avalon.framewor k.logger.L ogger;
import org.apache.avalon.framewor k.logger.C onsoleLogg er;
//FOP
import org.apache.fop.apps.Driver ;
import org.apache.fop.apps.FOPExc eption;
import org.apache.fop.messaging.M essageHand ler;
avalon framework came with the distribution of FOP, so thats fine, compiler is not complaining about that. What is dont like is org.apache.fop
ExampleFO2PDF.java:27: package org.apache.fop.apps does not exist
import org.apache.fop.apps.Driver ;
ExampleFO2PDF.java:28: package org.apache.fop.apps does not exist
import org.apache.fop.apps.FOPExc eption;
ExampleFO2PDF.java:29: package org.apache.fop.messaging does not exist
import org.apache.fop.messaging.M essageHand ler;
Because of this, the rest of the code is failing unknown symbols
This is all part of the velocity templating exercise Im doing. I have already got velocity templating to work, I just want to use FOP now.
Im using NetBeans v5.5 and Ive downloaded FOP 0.9.3
I am trying to create a simple example of creating a pdf
Within NetBeans project, I added all the JARs in the lib folder of FOP
Here is a snippet of my code
//Java
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
//SAX
import org.xml.sax.InputSource;
//Avalon
import org.apache.avalon.framewor
import org.apache.avalon.framewor
import org.apache.avalon.framewor
//FOP
import org.apache.fop.apps.Driver
import org.apache.fop.apps.FOPExc
import org.apache.fop.messaging.M
avalon framework came with the distribution of FOP, so thats fine, compiler is not complaining about that. What is dont like is org.apache.fop
ExampleFO2PDF.java:27: package org.apache.fop.apps does not exist
import org.apache.fop.apps.Driver
ExampleFO2PDF.java:28: package org.apache.fop.apps does not exist
import org.apache.fop.apps.FOPExc
ExampleFO2PDF.java:29: package org.apache.fop.messaging does not exist
import org.apache.fop.messaging.M
Because of this, the rest of the code is failing unknown symbols
This is all part of the velocity templating exercise Im doing. I have already got velocity templating to work, I just want to use FOP now.
ASKER
Yes I have
Im wondering now as the sample code I have is based on the older version of FOP and I am using the new version
So Im just double checking everything. I think this might be the issue
Im wondering now as the sample code I have is based on the older version of FOP and I am using the new version
So Im just double checking everything. I think this might be the issue
Please print output of
System.out.println(System. getPropert y("java.cl ass.path") );
System.out.println(System.
ASKER
Right back to tacking this
thanks for your response CEHJ, this is the output
C:\Java\fop-0.93\lib\avalo n-framewor k-4.2.0.ja r;C:\Java\ fop-0.93\l ib\batik-a ll-1.6.jar ;C:\Java\f op-0.93\li b\commons- io-1.1.jar ;C:\Java\f op-0.93\li b\commons- logging-1. 0.4.jar;C: \Java\fop- 0.93\lib\s erializer- 2.7.0.jar; C:\Java\fo p-0.93\lib \xalan-2.7 .0.jar;C:\ Java\fop-0 .93\lib\xe rcesImpl-2 .7.1.jar;C :\Java\fop -0.93\lib\ xml-apis-1 .3.02.jar; C:\Java\fo p-0.93\lib \xmlgraphi cs-commons -1.1.jar;C :\Java\FOP \fop-0.93\ lib\Jimi\e xamples\Ap pletDemo\J imiProClas ses.jar;C: \Dipak\Jav a\Code Examples\FOPit1\build\clas ses
I have installed FOP under c:\java as u can see
FOPit1 is the name of my project
I cannot find any libs for that missing package in this fop 0.9.3 distribution
thanks for your response CEHJ, this is the output
C:\Java\fop-0.93\lib\avalo
I have installed FOP under c:\java as u can see
FOPit1 is the name of my project
I cannot find any libs for that missing package in this fop 0.9.3 distribution
ASKER
I took the sample from here
http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_20_5/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup
then realised the version number of the example
http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_20_5/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup
then realised the version number of the example
Which of the below jars contains the FOP classes?
C:\Java\fop-0.93\lib\avalo n-framewor k-4.2.0.ja r
C:\Java\fop-0.93\lib\batik -all-1.6.j ar
C:\Java\fop-0.93\lib\commo ns-io-1.1. jar
C:\Java\fop-0.93\lib\commo ns-logging -1.0.4.jar
C:\Java\fop-0.93\lib\seria lizer-2.7. 0.jar
C:\Java\fop-0.93\lib\xalan -2.7.0.jar
C:\Java\fop-0.93\lib\xerce sImpl-2.7. 1.jar
C:\Java\fop-0.93\lib\xml-a pis-1.3.02 .jar
C:\Java\fop-0.93\lib\xmlgr aphics-com mons-1.1.j ar
C:\Java\FOP\fop-0.93\lib\J imi\exampl es\AppletD emo\JimiPr oClasses.j ar
C:\Dipak\Java\Code Examples\FOPit1\build\clas ses
C:\Java\fop-0.93\lib\avalo
C:\Java\fop-0.93\lib\batik
C:\Java\fop-0.93\lib\commo
C:\Java\fop-0.93\lib\commo
C:\Java\fop-0.93\lib\seria
C:\Java\fop-0.93\lib\xalan
C:\Java\fop-0.93\lib\xerce
C:\Java\fop-0.93\lib\xml-a
C:\Java\fop-0.93\lib\xmlgr
C:\Java\FOP\fop-0.93\lib\J
C:\Dipak\Java\Code Examples\FOPit1\build\clas
ASKER
Thats what Im trying to find out. This is what I think is missing. I dont know where it can be found. I took the binary and source download of FOP but it doesnt seem like its there
Im going thru other sample code, see if its a package in terms of source and not a library and I would then need to add that to my project
As Im new to FOP (and Java!), Im hoping some EE expert would be able to know what's missing
Im going thru other sample code, see if its a package in terms of source and not a library and I would then need to add that to my project
As Im new to FOP (and Java!), Im hoping some EE expert would be able to know what's missing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ive already downloaded that but I missed fop.jar. Must of been a long day as I did do a search for fop, perhaps I should of searched for *.jar instead, doh!
anyways, the two examples I have, one is now compiling (one listed above), the other does not, that is using fop.apps.Driver
It could be that it is no longer available.
Either way, problem is solved
Thank you very much for that. Sometimes it needs a 2nd pair of eyes to see something that is right in front of you
anyways, the two examples I have, one is now compiling (one listed above), the other does not, that is using fop.apps.Driver
It could be that it is no longer available.
Either way, problem is solved
Thank you very much for that. Sometimes it needs a 2nd pair of eyes to see something that is right in front of you
ASKER
Ive yet to write my first simple java program.
My first java program was to create a servlet using velocity templating, talk about going straight into the deep end! Next step is formatted objects
oh well
thanks for all your help, you have saved me a lot of hassle and frustration
My first java program was to create a servlet using velocity templating, talk about going straight into the deep end! Next step is formatted objects
oh well
thanks for all your help, you have saved me a lot of hassle and frustration
No problem - glad to help
:-)
:-)
Make sure you *really* have