Re: AW: AW: AW: Embedding FOP in Java

2002-09-21 Thread J.Pietschmann

Richard Van Deren wrote:
 I never got the logger to work.   I hope that you post your solution.
 It looks like there are errors in the documentation.   I read it several 
 times.
 There was a change to avalon's logger.  Then you can add your own via 
 the LogKit.
 I tried it several ways.
 I get a mismatch in the Logger class and LogKitLogger.
 
The trick seems to be to use a logger from the Avalon
framework rather than a LogKit logger.

J.Pietschmann


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




AW: AW: AW: AW: Embedding FOP in Java

2002-09-20 Thread Amin Schoeib

Hi J.Pietschmann,
Thanks for your help.
Can you tell me, where I can download 0.20.5cvs version of FOP ???

Thanxx

Schoeib


-Ursprüngliche Nachricht-
Von: J.Pietschmann [mailto:[EMAIL PROTECTED]] 
Gesendet: Donnerstag, 19. September 2002 21:46
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: AW: Embedding FOP in Java


Amin Schoeib wrote:
 I tried the code of JohnPT.
...
 java.lang.NullPointerException
  at org.apache.fop.fo.flow.Flow.setFlowName(Unknown Source)  at 
 org.apache.fop.fo.flow.Flow.init(Unknown Source)

This is the real problem. Ensure your fo:flow has a flow
name specified:
  fo:flow flow-name=xsl-region-body

Actually, FOP attempts to tell you exactly this but falls
over due to, well, some sort of mess...
(This is fixed in 0.20.5cvs)

J.Pietschmann


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


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




Re: AW: AW: AW: AW: Embedding FOP in Java

2002-09-20 Thread Paul . Hussein


http://xml.apache.org/forrest/xml-site/cvs.html#N1008F

module is xml-fop, not sure what the branch is sorry, think it might be
20.2

Hope this helps.

Regards

Paul.





Amin Schoeib [EMAIL PROTECTED] on 20/09/2002 13:14:26

Please respond to [EMAIL PROTECTED]



To:   [EMAIL PROTECTED]
cc:
Subject:  AW: AW: AW: AW: Embedding FOP in Java

Hi J.Pietschmann,
Thanks for your help.
Can you tell me, where I can download 0.20.5cvs version of FOP ???

Thanxx

Schoeib


-Ursprüngliche Nachricht-
Von: J.Pietschmann [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 19. September 2002 21:46
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: AW: Embedding FOP in Java


Amin Schoeib wrote:
 I tried the code of JohnPT.
...
 java.lang.NullPointerException
  at org.apache.fop.fo.flow.Flow.setFlowName(Unknown Source)  at
 org.apache.fop.fo.flow.Flow.init(Unknown Source)

This is the real problem. Ensure your fo:flow has a flow
name specified:
  fo:flow flow-name=xsl-region-body

Actually, FOP attempts to tell you exactly this but falls
over due to, well, some sort of mess...
(This is fixed in 0.20.5cvs)

J.Pietschmann


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


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







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




AW: AW: AW: AW: AW: Embedding FOP in Java

2002-09-20 Thread Amin Schoeib

Under this adress I found only version 0.20.4!
But where is the 0.20.5cvs version?


-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Gesendet: Freitag, 20. September 2002 14:35
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: AW: AW: Embedding FOP in Java



http://xml.apache.org/forrest/xml-site/cvs.html#N1008F

module is xml-fop, not sure what the branch is sorry, think it might be
20.2

Hope this helps.

Regards

Paul.





Amin Schoeib [EMAIL PROTECTED] on 20/09/2002 13:14:26

Please respond to [EMAIL PROTECTED]



To:   [EMAIL PROTECTED]
cc:
Subject:  AW: AW: AW: AW: Embedding FOP in Java

Hi J.Pietschmann,
Thanks for your help.
Can you tell me, where I can download 0.20.5cvs version of FOP ???

Thanxx

Schoeib


-Ursprüngliche Nachricht-
Von: J.Pietschmann [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 19. September 2002 21:46
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: AW: Embedding FOP in Java


Amin Schoeib wrote:
 I tried the code of JohnPT.
...
 java.lang.NullPointerException
  at org.apache.fop.fo.flow.Flow.setFlowName(Unknown Source)  at 
 org.apache.fop.fo.flow.Flow.init(Unknown Source)

This is the real problem. Ensure your fo:flow has a flow
name specified:
  fo:flow flow-name=xsl-region-body

Actually, FOP attempts to tell you exactly this but falls
over due to, well, some sort of mess...
(This is fixed in 0.20.5cvs)

J.Pietschmann


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


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







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


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




Re: Embedding FOP in Java

2002-09-20 Thread J.Pietschmann

Amin Schoeib wrote:
 Under this adress I found only version 0.20.4!
 But where is the 0.20.5cvs version?

Get a CVS client application and look into
docs/html-docs/download.html for further hints.

J.Pietschmann



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




Re: AW: AW: AW: Embedding FOP in Java

2002-09-20 Thread Richard Van Deren
I never got the logger to work.   I hope that you post your solution.
It looks like there are errors in the documentation.   I read it several times.
There was a change to avalon's logger.  Then you can add your own via the LogKit.
I tried it several ways.
I get a mismatch in the Logger class and LogKitLogger.

public  LogKitLogger log = null;

JavaCompile.default CompileJava>FopService.service 
MyFop.java:197: incompatible types
found   : org.apache.log.Logger
required: org.apache.avalon.framework.logger.LogKitLogger
log = Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
public void setMyLogger() {
log = Hierarchy.getDefaultHierarchy().getLoggerFor("fop"); // incompatible types
logger.setPriority( Priority.DEBUG );
logger.debug( "This is a debug message" );
Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
PatternFormatter formatter = new PatternFormatter(
"[%{priority}]: %{message}\n%{throwable}" );

LogTarget target = null;
target = new StreamTarget(System.out, formatter);

hierarchy.setDefaultLogTarget(target);
log = hierarchy.getLoggerFor("fop");
log.setPriority(Priority.INFO);
NSSystem.log("Logger is not set problem with logger compile");
}
On Wednesday, September 18, 2002, at 06:59 AM, Amin Schoeib wrote:

Hi,
I tried the code of JohnPT.
Here the result:
When I compile it, I become the following error:
 
"PdfRenderer.java": Error #: 300 : method setLogger(org.apache.log.Logger) not found in class org.apache.fop.apps.Driver at line 94, column 11
To make the code running I took out the line with setLogger.
The code compiled succesfully, but when I execute it I become the following:
 
[ERROR] Logger not set
 
[INFO] building formatting object tree
 
[WARNING] Screen logger not set.
 
javax.xml.transform.TransformerException
 
 at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:725)
 
 at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:426)
 
 at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:215)
 
 at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2324)
 
 at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2147)
 
 at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1203)
 
 at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:665)
 
 at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1119)
 
 at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1097)
 
 at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:105)
 
 at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:69)
 
 at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:122)
 
 at beraterfondsdaten.Trans.main(Trans.java:9)
 
-
 
Could not print stack trace...
 
-
 
java.lang.NullPointerException
 
 at org.apache.fop.fo.flow.Flow.setFlowName(Unknown Source)
 
 at org.apache.fop.fo.flow.Flow.init>(Unknown Source)
 
 at org.apache.fop.fo.flow.Flow$Maker.make(Unknown Source)
 
 at org.apache.fop.fo.FOTreeBuilder.startElement(Unknown Source)
 
 at org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.java:858)
 
 at org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:952)
 
 at org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:306)
 
 at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)
 
 at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:426)
 
 at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:215)
 
 at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2324)
 
 at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2147)
 
 at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1203)
 
 at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:665)
 
 at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1119)
 
 at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1097)
 
 at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:105)
 
 at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:69)
 
 at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:122)
 
 at beraterfondsdaten.Trans.main(Trans.java:9)
 
I don't understand that, I use the newest versions of FOP,XALAN,XERXES nd JAXP but it don't want to work.
What reason can this errors have?
 
thanxx
 
Schoeib


-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 17. September 2002 16:31
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: Embedding FOP in Java


I created a convenience class called PdfRenderer.

Re: AW: AW: AW: Embedding FOP in Java

2002-09-19 Thread jthaemlitz

The newer version probably uses the Avalon logger. This will throw the ERROR message, but should not break the code. You'll have to search for that fix in the archives.

It sounds like your not getting the right data in your FO file. Try running your data through the stylesheet on the command line. Then run it through FOP on the command line. You'll be able to analyze the files this way and see where your problem is. The following two commands should help.

# create the FO file
java org.apache.xalan.xslt.Process -in dataFile.xml -xsl styleSheet.xsl -out styleOutput.fo

# render the FO file to PDF
java org.apache.fop.apps.Fop -fo styleOutput.fo -pdf resulting.pdf

JohnPT

PS: sorry about the outdated logger code.







[EMAIL PROTECTED]
09/18/02 05:59 AM
Please respond to fop-dev


To:[EMAIL PROTECTED]
cc:
Subject:AW: AW: AW: Embedding FOP in Java


Hi,
I tried the code of JohnPT. 
Here the result:
When I compile it, I become the following error:

PdfRenderer.java: Error #: 300 : method setLogger(org.apache.log.Logger) not found in class org.apache.fop.apps.Driver at line 94, column 11
To make the code running I took out the line with setLogger.
The code compiled succesfully, but when I execute it I become the following:

[ERROR] Logger not set

[INFO] building formatting object tree

[WARNING] Screen logger not set.

javax.xml.transform.TransformerException

at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:725)

at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:426)

at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:215)

at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2324)

at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2147)

at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1203)

at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:665)

at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1119)

at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1097)

at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:105)

at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:69)

at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:122)

at beraterfondsdaten.Trans.main(Trans.java:9)

-

Could not print stack trace...

-

java.lang.NullPointerException

at org.apache.fop.fo.flow.Flow.setFlowName(Unknown Source)

at org.apache.fop.fo.flow.Flow.init(Unknown Source)

at org.apache.fop.fo.flow.Flow$Maker.make(Unknown Source)

at org.apache.fop.fo.FOTreeBuilder.startElement(Unknown Source)

at org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.java:858)

at org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:952)

at org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:306)

at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)

at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:426)

at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:215)

at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2324)

at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2147)

at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1203)

at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:665)

at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1119)

at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1097)

at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:105)

at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:69)

at beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:122)

at beraterfondsdaten.Trans.main(Trans.java:9)

I don't understand that, I use the newest versions of FOP,XALAN,XERXES nd JAXP but it don't want to work.
What reason can this errors have?

thanxx

Schoeib
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Gesendet: Dienstag, 17. September 2002 16:31
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: Embedding FOP in Java


I created a convenience class called PdfRenderer. It cache's a stylesheet and then you can process files or streams throught it. You can also pass parameters to your stylesheet with a hashtable (probably should have been a Hashmap). Anyway, it's not perfect, but it works and the class file shows exactly what classes and packages are needed. 

// you can call the class on xml files with the following 2 lines of code 
PdfRenderer render = new PdfRenderer( myxslfile.xsl ); 
render.run(input.xml, output.pdf); 

// or if you are building a xml string

Re: AW: AW: AW: Embedding FOP in Java

2002-09-19 Thread J.Pietschmann

Amin Schoeib wrote:
 I tried the code of JohnPT. 
...
 java.lang.NullPointerException
  at org.apache.fop.fo.flow.Flow.setFlowName(Unknown Source)
  at org.apache.fop.fo.flow.Flow.init(Unknown Source)

This is the real problem. Ensure your fo:flow has a flow
name specified:
  fo:flow flow-name=xsl-region-body

Actually, FOP attempts to tell you exactly this but falls
over due to, well, some sort of mess...
(This is fixed in 0.20.5cvs)

J.Pietschmann


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




AW: AW: AW: Embedding FOP in Java

2002-09-18 Thread Amin Schoeib
Title: Nachricht



Hi,
I 
tried the code of JohnPT. 
Here 
the result:
When I 
compile it, I become the following error:

"PdfRenderer.java": Error #: 300 : method 
setLogger(org.apache.log.Logger) not found in class org.apache.fop.apps.Driver 
at line 94, column 11
To 
make the code running I took out the line with setLogger.
The 
code compiled succesfully, but when I execute it I become the 
following:

[ERROR] Logger not set

[INFO] 
building formatting object tree

[WARNING] Screen logger not set.

javax.xml.transform.TransformerException

at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:725)

at 
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:426)

at 
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:215)

at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2324)

at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2147)

at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1203)

at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:665)

at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1119)

at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1097)

at 
beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:105)

at 
beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:69)

at 
beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:122)

at beraterfondsdaten.Trans.main(Trans.java:9)

-

Could 
not print stack trace...

-

java.lang.NullPointerException

at org.apache.fop.fo.flow.Flow.setFlowName(Unknown 
Source)

at org.apache.fop.fo.flow.Flow.init(Unknown 
Source)

at org.apache.fop.fo.flow.Flow$Maker.make(Unknown 
Source)

at org.apache.fop.fo.FOTreeBuilder.startElement(Unknown 
Source)

at 
org.apache.xalan.transformer.ResultTreeHandler.flushElem(ResultTreeHandler.java:858)

at 
org.apache.xalan.transformer.ResultTreeHandler.flushPending(ResultTreeHandler.java:952)

at 
org.apache.xalan.transformer.ResultTreeHandler.endElement(ResultTreeHandler.java:306)

at 
org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:716)

at 
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:426)

at 
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:215)

at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2324)

at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2147)

at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1203)

at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:665)

at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1119)

at 
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1097)

at 
beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:105)

at 
beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:69)

at 
beraterfondsdaten.PdfRenderer.run(PdfRenderer.java:122)

at beraterfondsdaten.Trans.main(Trans.java:9)

I 
don't understand that, I use the newest versions of FOP,XALAN,XERXES nd JAXP but 
it don't want to work.
What 
reason can this errors have?

thanxx

Schoeib

  
  -Ursprüngliche Nachricht-Von: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
  Gesendet: Dienstag, 17. September 2002 16:31An: 
  [EMAIL PROTECTED]Betreff: Re: AW: AW: Embedding FOP in 
  JavaI created a 
  convenience class called PdfRenderer. It cache's a stylesheet and then 
  you can process files or streams throught it. You can also pass 
  parameters to your stylesheet with a hashtable (probably should have been a 
  Hashmap). Anyway, it's not perfect, but it works and the class file 
  shows exactly what classes and packages are needed. // you can call the class on xml files with the 
  following 2 lines of code PdfRenderer 
  render = new PdfRenderer( "myxslfile.xsl" ); render.run("input.xml", "output.pdf"); // or if you are building a xml string in memory you 
  can do something like the following String xmlString = "tagsome kind of xml/tag"; 
  Source strSource = new StreamSource( new 
  StringReader(xmlString) ); OutputStream out = new FileOutputStream("outputstream.pdf"); 
  render.run( strSource, out ); 
  // or if you have a DOM object you can do 
  something like the following Hashtable 
  xslParams = new Hashtable(2); xslParams.put( "parameter1", "value1" ); xslParams.put( "parameter2", "value2" ); 
  Source source = new DOMSource( node ); 
  render.run( source, new FileOutputStream( 
  "dom.pdf" ), xslParams ); // 
  configs are done globally (statically) so you can call your config file 
  anytime before th

AW: Embedding FOP in Java

2002-09-17 Thread Amin Schoeib

Hi,
I already use the newest version of XALAN.
I use the following jar-files in my classpath:

avalon-framework-cvs-20020315.jar
batik.jar
fop.jar
xalan.jar
xercesImpl.jar

Are these the correct jar-files which I have to put in my classpath??

Thanxx

Schoeib


-Ursprüngliche Nachricht-
Von: J.Pietschmann [mailto:[EMAIL PROTECTED]] 
Gesendet: Montag, 16. September 2002 22:27
An: [EMAIL PROTECTED]
Betreff: Re: Embedding FOP in Java


Amin Schoeib wrote:
 Hi,
 I have a problem embedding FOP in Java.
 My code compile without any problems, but when I execute it, I become 
 a list of errors!
 
 I have the following code:
Sorry, irrelevant.
[snip]
 Here are the errors:
 
 java.lang.RuntimeException at

org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:32
 31)   

You trapped a run time error in Xalan. This is most likely cased by a
bug in you XSLT. Try to perform the transformation with the latest Xalan
version or Saxon, you'll probably get a diagnostic which will allow you
to fix the problem.

J.Pietschmann



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


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




Re: AW: Embedding FOP in Java

2002-09-17 Thread Christian Geisert

Amin Schoeib schrieb:
 Hi,
 I already use the newest version of XALAN.
 I use the following jar-files in my classpath:
 
 avalon-framework-cvs-20020315.jar
 batik.jar
 fop.jar
 xalan.jar
 xercesImpl.jar
 
 Are these the correct jar-files which I have to put in my classpath??

xml-apis.jar seems to be missing.

But I can't tell you if the versions are correct
and it also depends which FOP version you are using.

Christian


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




AW: AW: Embedding FOP in Java

2002-09-17 Thread Amin Schoeib

Hi,
I tried it also with adding the xml-apis.jar, but I become the same
error.
I use the newest version of FOP,XALAN and XERXES.
What other things can make problems??

Thanxx

Schoeib

-Ursprüngliche Nachricht-
Von: Christian Geisert [mailto:[EMAIL PROTECTED]] 
Gesendet: Dienstag, 17. September 2002 12:52
An: [EMAIL PROTECTED]
Betreff: Re: AW: Embedding FOP in Java


Amin Schoeib schrieb:
 Hi,
 I already use the newest version of XALAN.
 I use the following jar-files in my classpath:
 
 avalon-framework-cvs-20020315.jar
 batik.jar
 fop.jar
 xalan.jar
 xercesImpl.jar
 
 Are these the correct jar-files which I have to put in my classpath??

xml-apis.jar seems to be missing.

But I can't tell you if the versions are correct
and it also depends which FOP version you are using.

Christian


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


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




RE: AW: Embedding FOP in Java

2002-09-17 Thread Li, Francis

We use latest XALAN and latest FOP to generate HTML and PDF document. Since
we like to use latest version of XALAN and XERCES. We just pass the FO file
to FOP to handle PDF generation. We are able to use everything new, no
problem.


avalon-framework-20022706.jar
batik.jar
BCEL.jar
fop-0.20.4.jar
jaf-1.0.2.jar
jakarta-oro-2.0.4.jar
javamail-1.3.jar
java_cup.jar
log4j-1.2.6.jar
runtime.jar
xalan-2.4.0.jar
xercesImpl-2.1.0.jar
xml-apis.jar
xsltc.jar 


good luck.




-Original Message-
From: Amin Schoeib [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 7:22 AM
To: [EMAIL PROTECTED]
Subject: AW: AW: Embedding FOP in Java


Hi,
I tried it also with adding the xml-apis.jar, but I become the same
error.
I use the newest version of FOP,XALAN and XERXES.
What other things can make problems??

Thanxx

Schoeib

-Ursprüngliche Nachricht-
Von: Christian Geisert [mailto:[EMAIL PROTECTED]] 
Gesendet: Dienstag, 17. September 2002 12:52
An: [EMAIL PROTECTED]
Betreff: Re: AW: Embedding FOP in Java


Amin Schoeib schrieb:
 Hi,
 I already use the newest version of XALAN.
 I use the following jar-files in my classpath:
 
 avalon-framework-cvs-20020315.jar
 batik.jar
 fop.jar
 xalan.jar
 xercesImpl.jar
 
 Are these the correct jar-files which I have to put in my classpath??

xml-apis.jar seems to be missing.

But I can't tell you if the versions are correct
and it also depends which FOP version you are using.

Christian


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


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

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




AW: AW: Embedding FOP in Java

2002-09-17 Thread Amin Schoeib

Hi,
Can somebody please post a working example of an embedding FOP example
with java.
I need an example which can transform directly with a XML-File and and
XSL-File into PDF.
Please post also the needed jar-Files.

Thanxx

Schoeib

-Ursprüngliche Nachricht-
Von: Li, Francis [mailto:[EMAIL PROTECTED]] 
Gesendet: Dienstag, 17. September 2002 14:29
An: '[EMAIL PROTECTED]'
Betreff: RE: AW: Embedding FOP in Java


We use latest XALAN and latest FOP to generate HTML and PDF document.
Since we like to use latest version of XALAN and XERCES. We just pass
the FO file to FOP to handle PDF generation. We are able to use
everything new, no problem.


avalon-framework-20022706.jar
batik.jar
BCEL.jar
fop-0.20.4.jar
jaf-1.0.2.jar
jakarta-oro-2.0.4.jar
javamail-1.3.jar
java_cup.jar
log4j-1.2.6.jar
runtime.jar
xalan-2.4.0.jar
xercesImpl-2.1.0.jar
xml-apis.jar
xsltc.jar 


good luck.




-Original Message-
From: Amin Schoeib [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 7:22 AM
To: [EMAIL PROTECTED]
Subject: AW: AW: Embedding FOP in Java


Hi,
I tried it also with adding the xml-apis.jar, but I become the same
error. I use the newest version of FOP,XALAN and XERXES. What other
things can make problems??

Thanxx

Schoeib

-Ursprüngliche Nachricht-
Von: Christian Geisert [mailto:[EMAIL PROTECTED]] 
Gesendet: Dienstag, 17. September 2002 12:52
An: [EMAIL PROTECTED]
Betreff: Re: AW: Embedding FOP in Java


Amin Schoeib schrieb:
 Hi,
 I already use the newest version of XALAN.
 I use the following jar-files in my classpath:
 
 avalon-framework-cvs-20020315.jar
 batik.jar
 fop.jar
 xalan.jar
 xercesImpl.jar
 
 Are these the correct jar-files which I have to put in my classpath??

xml-apis.jar seems to be missing.

But I can't tell you if the versions are correct
and it also depends which FOP version you are using.

Christian


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


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

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


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




Re: AW: AW: Embedding FOP in Java

2002-09-17 Thread jthaemlitz

I created a convenience class called PdfRenderer. It cache's a stylesheet and then you can process files or streams throught it. You can also pass parameters to your stylesheet with a hashtable (probably should have been a Hashmap). Anyway, it's not perfect, but it works and the class file shows exactly what classes and packages are needed.

// you can call the class on xml files with the following 2 lines of code
PdfRenderer render = new PdfRenderer( myxslfile.xsl );
render.run(input.xml, output.pdf);

// or if you are building a xml string in memory you can do something like the following
String xmlString = tagsome kind of xml/tag;
Source strSource = new StreamSource( new StringReader(xmlString) );
OutputStream out = new FileOutputStream(outputstream.pdf);
render.run( strSource, out );

// or if you have a DOM object you can do something like the following
Hashtable xslParams = new Hashtable(2);
xslParams.put( parameter1, value1 );
xslParams.put( parameter2, value2 );
Source source = new DOMSource( node );
render.run( source, new FileOutputStream( dom.pdf ), xslParams );

// configs are done globally (statically) so you can call your config file anytime before the run statements
File userConfigFile = new File( userconfig.xml );
org.apache.fop.apps.Options options = new org.apache.fop.apps.Options( userConfigFile );

Hope that helps. This class cleaned up a bunch of my code.

JohnPT









[EMAIL PROTECTED]
09/17/02 07:36 AM
Please respond to fop-dev


To:[EMAIL PROTECTED]
cc:
Subject:AW: AW: Embedding FOP in Java


Hi,
Can somebody please post a working example of an embedding FOP example
with java.
I need an example which can transform directly with a XML-File and and
XSL-File into PDF.
Please post also the needed jar-Files.

Thanxx

Schoeib

-Ursprüngliche Nachricht-
Von: Li, Francis [mailto:[EMAIL PROTECTED]] 
Gesendet: Dienstag, 17. September 2002 14:29
An: '[EMAIL PROTECTED]'
Betreff: RE: AW: Embedding FOP in Java


We use latest XALAN and latest FOP to generate HTML and PDF document.
Since we like to use latest version of XALAN and XERCES. We just pass
the FO file to FOP to handle PDF generation. We are able to use
everything new, no problem.


avalon-framework-20022706.jar
batik.jar
BCEL.jar
fop-0.20.4.jar
jaf-1.0.2.jar
jakarta-oro-2.0.4.jar
javamail-1.3.jar
java_cup.jar
log4j-1.2.6.jar
runtime.jar
xalan-2.4.0.jar
xercesImpl-2.1.0.jar
xml-apis.jar
xsltc.jar 


good luck.




-Original Message-
From: Amin Schoeib [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 17, 2002 7:22 AM
To: [EMAIL PROTECTED]
Subject: AW: AW: Embedding FOP in Java


Hi,
I tried it also with adding the xml-apis.jar, but I become the same
error. I use the newest version of FOP,XALAN and XERXES. What other
things can make problems??

Thanxx

Schoeib

-Ursprüngliche Nachricht-
Von: Christian Geisert [mailto:[EMAIL PROTECTED]] 
Gesendet: Dienstag, 17. September 2002 12:52
An: [EMAIL PROTECTED]
Betreff: Re: AW: Embedding FOP in Java


Amin Schoeib schrieb:
 Hi,
 I already use the newest version of XALAN.
 I use the following jar-files in my classpath:
 
 avalon-framework-cvs-20020315.jar
 batik.jar
 fop.jar
 xalan.jar
 xercesImpl.jar
 
 Are these the correct jar-files which I have to put in my classpath??

xml-apis.jar seems to be missing.

But I can't tell you if the versions are correct
and it also depends which FOP version you are using.

Christian


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


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

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


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





PdfRenderer.java
Description: Binary data

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


Re: AW: Embedding FOP in Java

2002-09-17 Thread J.Pietschmann

Amin Schoeib wrote:
 I already use the newest version of XALAN.

Quite a few people belive they use the latest or a specific
version of whatever, often without any evidence and
occasionally even without turning on their brain.

 Are these the correct jar-files which I have to put in my classpath??

Maybe, or maybe not. Even if they are, there could be
older versions with known bugs used because they are in
the classpath too, as it happens in case you are using
JDK1.4. The Xalan distributed with FOP 0.20.4 has also
a few known problems.

The whole point was: Get a recent Xalan distribution (2.4.0)
and/or Saxon 6.5.4. Run your XML+XSL through the command line
application distributed with Xalan or the application form
Saxon (check the docs for details). If you get a problem
diagnostic, fix your XSL. In the somewhat improbable case
your XSL is ok, feed the resulting FO file to the FOP command
line application to ssee what happens, and if this is still
ok replace the xalan.jar from the FOP distribution with the
xalan.jar from the Xalan distribution.

J.Pietschmann



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




Embedding FOP in servlet

2002-08-21 Thread siva

Hi friends,

I'm new to FOP, I have requirement to generate PDF file from XML  XSL...
I have down loaded fop.0.20.4, trying to use FopServlet.java on tomcat3.2.2 
but it throws lot of errors, inspite of following the procedure given in the 
docs... I'am not able to understand it...

So, If anybody have implemented Embedding FopServlet.java on tomcat3.2.2 
please help me...

thanks in advance
-Siva 


_
Any Opinions, explicit or implied, are solely those of the author and do not 
necessarily
represent those of Questech. This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient (or have received this e-mail in 
error)
please notify the sender immediately and destroy this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
_



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




Problem in Embedding FOP in servlet

2002-08-13 Thread ssimha

Hi friends, 

I'm facing a problem in embedding FOP(0.20.4 version 13-Jun-2002) into my 
servlet...  written a servlet to generate PDF file making use of XML and XSL 
files. It's works fine... when this servlet runs on tomcat3.1.  BUT if I copy 
whole context to tomcat3.2.2 and above versions it's throwing following 
error...

Internal Servlet Error:

java.lang.NoSuchMethodError
at org.apache.fop.apps.Driver.getParserClassName(Unknown Source)
at org.apache.fop.svg.SVGElementMapping.setupSVG(Unknown Source)
at org.apache.fop.svg.SVGElementMapping.addToBuilder(Unknown Source)
at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
at org.apache.fop.apps.Driver.setupDefaultMappings(Unknown Source)
at org.apache.fop.apps.Driver.(Unknown Source)
at fop.FopServlet.renderXMLViewPDF(FopServlet.java:327)
at fop.FopServlet.doGet(FopServlet.java:168)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:743)
at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection
(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)

All my jar related to FOP is in my own context WEB-INF/classes/lib 
directory.  I hope someone can help me
I also want to know...  I'm using right version of FOP or not???

Thanks in advance...
Shekar Simha Y.
_
Any Opinions, explicit or implied, are solely those of the author and do not 
necessarily
represent those of Questech. This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient (or have received this e-mail in 
error)
please notify the sender immediately and destroy this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
_



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




Re: Problem in Embedding FOP in servlet

2002-08-13 Thread Jamal Mohamed A Abdul Sathar

check out ur xsl file is correct
or
in servlet did u pass xml and xsl file into XSLTInputhandler
try out this and reply


From: ssimha [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Problem in Embedding FOP in servlet Date: Tue, 13 Aug 2002 
15:44:19 +0530

Hi friends,

I'm facing a problem in embedding FOP(0.20.4 version 13-Jun-2002) into my
servlet...  written a servlet to generate PDF file making use of XML and 
XSL
files. It's works fine... when this servlet runs on tomcat3.1.  BUT if I 
copy
whole context to tomcat3.2.2 and above versions it's throwing following
error...

Internal Servlet Error:

java.lang.NoSuchMethodError
 at org.apache.fop.apps.Driver.getParserClassName(Unknown Source)
 at org.apache.fop.svg.SVGElementMapping.setupSVG(Unknown Source)
 at org.apache.fop.svg.SVGElementMapping.addToBuilder(Unknown Source)
 at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
 at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
 at org.apache.fop.apps.Driver.setupDefaultMappings(Unknown Source)
 at org.apache.fop.apps.Driver.(Unknown Source)
 at fop.FopServlet.renderXMLViewPDF(FopServlet.java:327)
 at fop.FopServlet.doGet(FopServlet.java:168)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService
(ServletWrapper.java:405)
 at org.apache.tomcat.core.Handler.service(Handler.java:287)
 at org.apache.tomcat.core.ServletWrapper.service
(ServletWrapper.java:372)
 at org.apache.tomcat.core.ContextManager.internalService
(ContextManager.java:797)
 at org.apache.tomcat.core.ContextManager.service
(ContextManager.java:743)
 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection
(HttpConnectionHandler.java:213)
 at org.apache.tomcat.service.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:416)
 at org.apache.tomcat.util.ThreadPool$ControlRunnable.run
(ThreadPool.java:501)
 at java.lang.Thread.run(Thread.java:484)

All my jar related to FOP is in my own context WEB-INF/classes/lib
directory.  I hope someone can help me
I also want to know...  I'm using right version of FOP or not???

Thanks in advance...
Shekar Simha Y.
_
Any Opinions, explicit or implied, are solely those of the author and do 
not necessarily
represent those of Questech. This e-mail may contain confidential and/or 
privileged
information. If you are not the intended recipient (or have received this 
e-mail in error)
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly 
forbidden.
_



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




_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




Re: Problem in Embedding FOP in servlet

2002-08-13 Thread ssimha

thanks for the reply...
yeah... my xsl file is fine and passing xml  xsl file into XSLTInputhandler..
My servlet works fine with FOP(0.20.4 version 13-Jun-2002) and tomcat3.1 

BUT throws error while I put the same context into tomcat3.2.2(as my whole 
application  is running on tomcat3.2.2)
I have wasted lot of time finding solution for this... somebody help me...

regards
-shekar


 check out ur xsl file is correct
 or
 in servlet did u pass xml and xsl file into XSLTInputhandler
 try out this and reply
 
 From: ssimha [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Problem in Embedding FOP in servlet Date: Tue, 13 Aug 2002 
 15:44:19 +0530
 
 Hi friends,
 
 I'm facing a problem in embedding FOP(0.20.4 version 13-Jun-2002) into my
 servlet...  written a servlet to generate PDF file making use of XML and 
 XSL
 files. It's works fine... when this servlet runs on tomcat3.1.  BUT if I 
 copy
 whole context to tomcat3.2.2 and above versions it's throwing following
 error...
 
 Internal Servlet Error:
 
 java.lang.NoSuchMethodError
  at org.apache.fop.apps.Driver.getParserClassName(Unknown Source)
  at org.apache.fop.svg.SVGElementMapping.setupSVG(Unknown Source)
  at org.apache.fop.svg.SVGElementMapping.addToBuilder(Unknown Source)
  at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
  at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
  at org.apache.fop.apps.Driver.setupDefaultMappings(Unknown Source)
  at org.apache.fop.apps.Driver.(Unknown Source)
  at fop.FopServlet.renderXMLViewPDF(FopServlet.java:327)
  at fop.FopServlet.doGet(FopServlet.java:168)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at org.apache.tomcat.core.ServletWrapper.doService
 (ServletWrapper.java:405)
  at org.apache.tomcat.core.Handler.service(Handler.java:287)
  at org.apache.tomcat.core.ServletWrapper.service
 (ServletWrapper.java:372)
  at org.apache.tomcat.core.ContextManager.internalService
 (ContextManager.java:797)
  at org.apache.tomcat.core.ContextManager.service
 (ContextManager.java:743)
  at
 org.apache.tomcat.service.http.HttpConnectionHandler.processConnection
 (HttpConnectionHandler.java:213)
  at org.apache.tomcat.service.TcpWorkerThread.runIt
 (PoolTcpEndpoint.java:416)
  at org.apache.tomcat.util.ThreadPool$ControlRunnable.run
 (ThreadPool.java:501)
  at java.lang.Thread.run(Thread.java:484)
 
 All my jar related to FOP is in my own context WEB-INF/classes/lib
 directory.  I hope someone can help me
 I also want to know...  I'm using right version of FOP or not???
 
 Thanks in advance...
 Shekar Simha Y.
 _
 Any Opinions, explicit or implied, are solely those of the author and do 
 not necessarily
 represent those of Questech. This e-mail may contain confidential and/or 
 privileged
 information. If you are not the intended recipient (or have received this 
 e-mail in error)
 please notify the sender immediately and destroy this e-mail. Any 
 unauthorized copying,
 disclosure or distribution of the material in this e-mail is strictly 
 forbidden.
 _
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 
 _
 MSN Photos is the easiest way to share and print your photos: 
 http://photos.msn.com/support/worldwide.aspx
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


Shekar Simha Y

_
Any Opinions, explicit or implied, are solely those of the author and do not 
necessarily
represent those of Questech. This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient (or have received this e-mail in 
error)
please notify the sender immediately and destroy this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
_



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




Re: Problem in Embedding FOP in servlet

2002-08-13 Thread Oleg Tkachenko

ssimha wrote:

 I'm facing a problem in embedding FOP(0.20.4 version 13-Jun-2002) into my 
 servlet...  written a servlet to generate PDF file making use of XML and XSL 
 files. It's works fine... when this servlet runs on tomcat3.1.  BUT if I copy 
 whole context to tomcat3.2.2 and above versions it's throwing following 
 error...
 
 Internal Servlet Error:
 
 java.lang.NoSuchMethodError
 at org.apache.fop.apps.Driver.getParserClassName(Unknown Source)
 at org.apache.fop.svg.SVGElementMapping.setupSVG(Unknown Source)

Seems to me it's no SAX2 compliant parser is in use, try to upgrade tomcat's 
xerces or whatever it uses as parser. Turn debug on in order to see which 
parser are you using.

-- 
Oleg Tkachenko
Multiconn International, Israel


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




AW: AW: AW: Embedding FOP in Servlet

2002-07-25 Thread Martin Ewald

Hi Christian, hi Oleg,

your tips were great. It was a classpath problem. After many attempts, I found out 
that the
file xerces.jar was missed. I'm so stupid. Now tomcat delivers a pdf-document how I 
can see
in my MIE 5. I get the pdf-source-code but I hope I will correct this.

Thank you very much.

Martin








-Ursprüngliche Nachricht-
Von: Christian Geisert [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 24. Juli 2002 19:08
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: Embedding FOP in Servlet


Martin Ewald schrieb:
  Hi Oleg,
 
  I have searched all possibilities where a fop could be referenced by 
tomcat to be sure it's
  the only one. To test I've deleted the fop.jar from the subdirectory 
'C:\jakarta-tomcat-4.0.1\webapps\fop\WEB-INF\lib'
  and the servlet fails completely because of missing classes. Then I 
have built up fop.jar again with ant, but
  I always get the same error message:
  java.lang.IllegalArgumentException: 
org.apache.fop.svg.SVGElementMapping is not an ElementMapping
   at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
   at org.apache.fop.apps.Driver.setupDefaultMappings(Unknown Source)
   at org.apache.fop.apps.Driver.(Unknown Source)
 
  Could this be a question of access rights to the driver.class, 
because the command line variant succeeded?

As Oleg already mentioned this really sounds like a classpath issue.
Is the correct batik.jar there?


Christian




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


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




AW: Embedding FOP in Servlet

2002-07-24 Thread Martin Ewald

Hi Oleg,

first thanx for your response. It's indeed an ClassCastException. You're right, but 
fop.far
is from July 2002, so it's new. I make an attempt from command line and wrote
following short programm which works fine. Hmm!
What is wrong with the servlet, what goes wrong during Driver driver = new Driver();?
Any idea?

Martin

### Command Line Programmm 
import java.io.*;
import org.xml.sax.*;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import org.apache.fop.apps.Driver;
import org.apache.fop.apps.Version;
import org.apache.fop.apps.InputHandler;
import org.apache.fop.apps.XSLTInputHandler;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.svg.*;
import org.apache.fop.fo.*;

import org.apache.batik.util.XMLResourceDescriptor;
import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.avalon.framework.logger.Logger;


public class fopdriver {
 public static void main(String[] args) {
try {
  Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PDF);
  File xmlFile = new 
File(C:\\jakarta-tomcat-4.0.1\\webapps\\fop\\WEB-INF\\lib\\glossary.xml);
  File xslFile = new 
File(C:\\jakarta-tomcat-4.0.1\\webapps\\fop\\WEB-INF\\lib\\glossary.xsl);
  File outFile = new 
File(C:\\jakarta-tomcat-4.0.1\\webapps\\fop\\WEB-INF\\lib\\glossary.pdf);
  InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
  XMLReader parser = inputHandler.getParser();
  driver.setOutputStream(new FileOutputStream(outFile));
  driver.render(parser, inputHandler.getInputSource());
} catch (Exception ex) {
 System.out.println(Lade neuen driver Kon2);
}
}
}
###




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




Re: AW: Embedding FOP in Servlet

2002-07-24 Thread Oleg Tkachenko

Martin Ewald wrote:

 first thanx for your response. It's indeed an ClassCastException. You're right, but 
fop.far
 is from July 2002, so it's new. I make an attempt from command line and wrote
 following short programm which works fine. Hmm!
You could also run fop.bat (or fop.sh) script instead.

 What is wrong with the servlet, what goes wrong during Driver driver = new 
Driver();?
 Any idea?
I meant not your fop is old, but may be somewhere in the tomcat classpath does 
exist older fop or something.

-- 
Oleg Tkachenko
Multiconn International, Israel


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




AW: AW: Embedding FOP in Servlet

2002-07-24 Thread Martin Ewald

Hi Oleg,

I have searched all possibilities where a fop could be referenced by tomcat to be sure 
it's 
the only one. To test I've deleted the fop.jar from the subdirectory 
'C:\jakarta-tomcat-4.0.1\webapps\fop\WEB-INF\lib'
and the servlet fails completely because of missing classes. Then I have built up 
fop.jar again with ant, but
I always get the same error message:
java.lang.IllegalArgumentException: org.apache.fop.svg.SVGElementMapping is not an 
ElementMapping
at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
at org.apache.fop.apps.Driver.setupDefaultMappings(Unknown Source)
at org.apache.fop.apps.Driver.(Unknown Source)

Could this be a question of access rights to the driver.class, because the command 
line variant succeeded?

Kind regards
Martin



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




Re: AW: AW: Embedding FOP in Servlet

2002-07-24 Thread Christian Geisert

Martin Ewald schrieb:
  Hi Oleg,
 
  I have searched all possibilities where a fop could be referenced by 
tomcat to be sure it's
  the only one. To test I've deleted the fop.jar from the subdirectory 
'C:\jakarta-tomcat-4.0.1\webapps\fop\WEB-INF\lib'
  and the servlet fails completely because of missing classes. Then I 
have built up fop.jar again with ant, but
  I always get the same error message:
  java.lang.IllegalArgumentException: 
org.apache.fop.svg.SVGElementMapping is not an ElementMapping
   at org.apache.fop.apps.Driver.addElementMapping(Unknown Source)
   at org.apache.fop.apps.Driver.setupDefaultMappings(Unknown Source)
   at org.apache.fop.apps.Driver.(Unknown Source)
 
  Could this be a question of access rights to the driver.class, 
because the command line variant succeeded?

As Oleg already mentioned this really sounds like a classpath issue.
Is the correct batik.jar there?


Christian




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




Re: Embedding FOP

2002-04-19 Thread Hans-Jürgen Wiesner



Rhett Aultman schrieb:
 

 
 This may sound like a bizarre question, but you are transforming the XHTML to a FO 
document before you attemt to render it, right?  To the best of my knowledge, you 
must perform your own transforms and provide FOP with valid FO.  Are you using a 
technique like the recommended one for going from an XML document to FO like this one 
listed on the FOP website:
 
 Driver driver = new Driver();
   driver.setRenderer(Driver.RENDER_PDF);
   InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
   XMLReader parser = inputHandler.getParser();
   driver.setOutputStream(new FileOutputStream(outFile));
   driver.render(parser, inputHandler.getInputSource());
 

That's what I'm doing in my Filter. I wrote the code just like in the
embedding examples in the
FOP documentation; after some weird exceptions, I found out FOP used an
Oracle parser from the class path, so I explicitly had to set it up to
use the SAX-Parser. The complete snippet looks like this:

Driver driver = new Driver() ;
driver.setLogger(fopLog) ;
driver.setRenderer(Driver.RENDER_PDF) ;
driver.addElementMapping(org.apache.fop.fo.StandardElementMapping);
driver.setOutputStream(out) ;
XSLTInputHandler xsltInput = new XSLTInputHandler (inputFile,
stylesheet) ;   
XMLReader parser = (XMLReader)
Class.forName(org.apache.xerces.parsers.SAXParser).newInstance();
driver.render(parser, xsltInput.getInputSource()) ;


Can't see any difference to your example... except that it doesn't work,
of course.
Thanks,
Hans

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




Re: Embedding FOP

2002-04-19 Thread Keiron Liddle


The difference, though subtle, is that the you are not using the parser 
from the XSLTInputHandler. Calling get parser sets a boolean value which 
enables the transformation. Otherwise it simply returns a file input 
source for the xml file.
So get the parser from the XSLTInputSource.
.. and we will look into fixing this bug.

On 2002.04.19 08:48 Hans-Jürgen Wiesner wrote:
 Rhett Aultman schrieb:
 
 
 
  This may sound like a bizarre question, but you are transforming the
 XHTML to a FO document before you attemt to render it, right?  To the
 best of my knowledge, you must perform your own transforms and provide
 FOP with valid FO.  Are you using a technique like the recommended one
 for going from an XML document to FO like this one listed on the FOP
 website:
 
  Driver driver = new Driver();
driver.setRenderer(Driver.RENDER_PDF);
InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
XMLReader parser = inputHandler.getParser();
driver.setOutputStream(new FileOutputStream(outFile));
driver.render(parser, inputHandler.getInputSource());
 
 
 That's what I'm doing in my Filter. I wrote the code just like in the
 embedding examples in the
 FOP documentation; after some weird exceptions, I found out FOP used an
 Oracle parser from the class path, so I explicitly had to set it up to
 use the SAX-Parser. The complete snippet looks like this:
 
 Driver driver = new Driver() ;
 driver.setLogger(fopLog) ;
 driver.setRenderer(Driver.RENDER_PDF) ;
 driver.addElementMapping(org.apache.fop.fo.StandardElementMapping);
 driver.setOutputStream(out) ;
 XSLTInputHandler xsltInput = new XSLTInputHandler (inputFile,
 stylesheet) ;  
 XMLReader parser = (XMLReader)
 Class.forName(org.apache.xerces.parsers.SAXParser).newInstance();
 driver.render(parser, xsltInput.getInputSource()) ;
 
 
 Can't see any difference to your example... except that it doesn't work,
 of course.
 Thanks,
 Hans

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




RE: Embedding FOP

2002-04-18 Thread Rhett Aultman



-Original Message-
From: Hans-Jürgen Wiesner [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 10:21 AM
To: [EMAIL PROTECTED]
Subject: Embedding FOP

[snip]


INFO10191   [fop ] (): building formatting object tree
DEBUG   10191   [fop ] (): setting up fonts
ERROR   10191   [fop ] (): Unknown formatting object ^html

The message text of the exception says:

Root element must be root, not (none):html

This seems to mean my DTD, which I deleteted; if I use a valid DTD:
!DOCTYPE xhtml PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;




This may sound like a bizarre question, but you are transforming the XHTML to a FO 
document before you attemt to render it, right?  To the best of my knowledge, you must 
perform your own transforms and provide FOP with valid FO.  Are you using a technique 
like the recommended one for going from an XML document to FO like this one listed on 
the FOP website:

Driver driver = new Driver();
  driver.setRenderer(Driver.RENDER_PDF);
  InputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
  XMLReader parser = inputHandler.getParser();
  driver.setOutputStream(new FileOutputStream(outFile));
  driver.render(parser, inputHandler.getInputSource());

I just ask because, if your XHTML what's getting into driver.render(), it's going to 
blow up.


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




Re: Embedding FOP

2002-04-18 Thread J.Pietschmann

Hans-Jürgen Wiesner wrote:
 Hello all,
 I'm new to FOP and are charged with embedding it in a Servlet
 application. We need to send a JSP as HTML or PDF, depending on the
 user. So we made a JSP which outputs valid XHTML and tried to convert
 that via FO into PDF.
 After much experimentation, I succeeded in installing a filter
 intercepting the JSP-Servlets output to convert it by calling FOP.
 The conversion works on the command line; however, I have great problems
 embedding FOP in my filter.

It is usually not a good idea to use JSP to generate
XML for further processing.

Well, you can use a SAX event stream to overcome the
unfortunate design of the XSLTInputHandler, look here:
  http://marc.theaimsgroup.com/?l=fop-userm=101735493205659w=2
This way you can supply an arbitrary XML source to your
transformer.
For generating the data, i suggest to look into writing
your own SAX source. The basics are much easier than many
people think: implement the javax.xml.parser.XMLReader
interface, and if necessary provide your own implementation
of an InputSource to provide run time parametrization.

 The next problem is that FOP doesn't convert when called from my filter.
 I get an exception from driver.render(); the logger tells me:
 
 INFO10191   [fop ] (): building formatting object tree
 DEBUG   10191   [fop ] (): setting up fonts
 ERROR   10191   [fop ] (): Unknown formatting object ^html
 
Your transformation transforms your XML to XHTML. You have
to write a transformation which transforms into XSLFO. FOP
can not render XHTML (it would be named XHTMLP if it could)

J.Pietschmann


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




Difficulties embedding FOP by firing SAX events myself

2001-11-15 Thread Smith, Paul

Hi,

I am trying to embed FOP within my own Java application as described in
http://xml.apache.org/fop/embedding.html, specifically the third method:
calling getContentHandler() and firing the SAX events yourself and I am
running into difficulties!

I have a class called MyParser which fires the required events (it
implements XMLReader). Its parse method that calls SAX events on
ContentHandler and ignores the InputStream. If I do:
(I have simplifed the code samples so their maybe a few typos)

MyParser parser = new MyParser();
XMLSerializer serializer = new XMLSerializer(new
FileOutputStream(output.fo), new OutputFormat(method, encoding,
indenting));
ContentHandler handler = serializer.asContentHandler();
parser.setContentHandler(handler);
parser.parse(new InputStream());

Then I can produce a well formed XSL-FO file that validates against the DTD
provided by N. Grigoriev from RenderX. Running fop on this file eg. fop
output.fo output.pdf, generates output.pdf successfully.

HOWEVER, If I try and embed FOP by doing:

Driver driver = new Driver();
driver.setOutputStream(new FileOutputStream(output.pdf);
driver.setInputSource(new InputSource());
Logger logger =
Hierarchy.getDefaultHierarchy().getLoggerFor(foRender);
logger.setPriority(Priority.INFO);
driver.setLogger(logger);

MyParser parser = new MyParser();
driver.render(parser, new InputSource());

FOP generates output.pdf but when opened in Acrobat Reader I get There was
an error opening this document. Could not repair file.
Closer inspection shows that the PDF has not been correctly generated at
all. The first 9 lines look like:

%PDF-1.3
%ª«¬­
4 0 obj
 /Type /Info
/Producer (null) 
endobj
5 0 obj
 /Length 235 /Filter /FlateDecode 
 

where as the first 9 lines of the PDF generated by running FOP from the
command line look like:

%PDF-1.3
%ª«¬­
4 0 obj
 /Type /Info
/Producer (FOP 0.20.1) 
endobj
5 0 obj
 /Length 296 /Filter [ /ASCII85Decode /FlateDecode ]
 

During driver.render the logger prints out:

INFO10058   [foRender] (): building formatting object tree
DEBUG   10058   [fop ] (): setting up fonts
INFO10058   [foRender] (): [1]


Any help you can offer is much appreciated. Thanks in advance

---
Paul Smith


***
DISCLAIMER: The information contained in this email
 is confidential and is intended solely for the use of the
 named addressee.  Access, copying or re-use of the
 information in it by any other person is not authorised.



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




RE: Difficulties embedding FOP by firing SAX events myself

2001-11-15 Thread Smith, Paul

Unfortunately I am using Java 1.3.1, javax.xml.* doesn't make an appearance
until 1.4 so I can't use TransformerFactory.

---
Paul Smith

 -Original Message-
 From: Beer, Christian [mailto:[EMAIL PROTECTED]]
 Sent: 15 November 2001 13:14
 To: '[EMAIL PROTECTED]'
 Subject: AW: Difficulties embedding FOP by firing SAX events myself
 
 
 I did it this way:
 
 code
 // FO -- PDF
 driver.reset();
 driver.setOutputStream(pdf);
 driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF);
 
 TransformerFactory tFactory = TransformerFactory.newInstance();
 if (tFactory.getFeature(SAXSource.FEATURE) 
 tFactory.getFeature(SAXResult.FEATURE)) {
   SAXTransformerFactory saxTFactory = 
 ((SAXTransformerFactory)tFactory);
 
   TransformerHandler th = saxTFactory.newTransformerHandler(new
 StreamSource(xsl));
 
   // Create SAXResult based on FOP Driver content handler 
 which will accept
   // SAX events and build FOP tree
   SAXResult saxResult = new SAXResult(driver.getContentHandler());
 
   th.setResult(saxResult);
 comment
 
 Now you can use th as a ContentHandler and fire the events on it!
 
 /comment
   pdf.close();
 }
 /code
 
 Christian
 
 -Ursprüngliche Nachricht-
 Von: Smith, Paul [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 15. November 2001 13:11
 An: Fop-Dev (E-mail)
 Cc: Smith, Paul
 Betreff: Difficulties embedding FOP by firing SAX events myself
 
 
 Hi,
 
 I am trying to embed FOP within my own Java application as 
 described in
 http://xml.apache.org/fop/embedding.html, specifically the 
 third method:
 calling getContentHandler() and firing the SAX events 
 yourself and I am
 running into difficulties!
 
 I have a class called MyParser which fires the required events (it
 implements XMLReader). Its parse method that calls SAX events on
 ContentHandler and ignores the InputStream. If I do:
 (I have simplifed the code samples so their maybe a few typos)
 
   MyParser parser = new MyParser();
   XMLSerializer serializer = new XMLSerializer(new
 FileOutputStream(output.fo), new OutputFormat(method, encoding,
 indenting));
   ContentHandler handler = serializer.asContentHandler();
   parser.setContentHandler(handler);
   parser.parse(new InputStream());
 
 Then I can produce a well formed XSL-FO file that validates 
 against the DTD
 provided by N. Grigoriev from RenderX. Running fop on this 
 file eg. fop
 output.fo output.pdf, generates output.pdf successfully.
 
 HOWEVER, If I try and embed FOP by doing:
 
   Driver driver = new Driver();
   driver.setOutputStream(new FileOutputStream(output.pdf);
   driver.setInputSource(new InputSource());
   Logger logger =
 Hierarchy.getDefaultHierarchy().getLoggerFor(foRender);
   logger.setPriority(Priority.INFO);
   driver.setLogger(logger);
   
   MyParser parser = new MyParser();
   driver.render(parser, new InputSource());
   
 FOP generates output.pdf but when opened in Acrobat Reader I 
 get There was
 an error opening this document. Could not repair file.
 Closer inspection shows that the PDF has not been correctly 
 generated at
 all. The first 9 lines look like:
 
 %PDF-1.3
 %ª«¬­
 4 0 obj
  /Type /Info
 /Producer (null) 
 endobj
 5 0 obj
  /Length 235 /Filter /FlateDecode 
  
 
 where as the first 9 lines of the PDF generated by running 
 FOP from the
 command line look like:
 
 %PDF-1.3
 %ª«¬­
 4 0 obj
  /Type /Info
 /Producer (FOP 0.20.1) 
 endobj
 5 0 obj
  /Length 296 /Filter [ /ASCII85Decode /FlateDecode ]
  
 
 During driver.render the logger prints out:
 
 INFO10058   [foRender] (): building formatting object tree
 DEBUG   10058   [fop ] (): setting up fonts
 INFO10058   [foRender] (): [1]
 
 
 Any help you can offer is much appreciated. Thanks in advance
 
 ---
 Paul Smith
 
 
 ***
 DISCLAIMER: The information contained in this email
  is confidential and is intended solely for the use of the
  named addressee.  Access, copying or re-use of the
  information in it by any other person is not authorised.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


***
DISCLAIMER: The information contained in this email
 is confidential and is intended solely for the use of the
 named addressee.  Access, copying or re-use of the
 information in it by any other person is not authorised.



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

AW: Difficulties embedding FOP by firing SAX events myself

2001-11-15 Thread Beer, Christian

But fop uses xerces and xalan. This two packages contain all xml-stuff!

-Ursprüngliche Nachricht-
Von: Smith, Paul [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 15. November 2001 14:44
An: '[EMAIL PROTECTED]'
Betreff: RE: Difficulties embedding FOP by firing SAX events myself


Unfortunately I am using Java 1.3.1, javax.xml.* doesn't make an appearance
until 1.4 so I can't use TransformerFactory.

---
Paul Smith

 -Original Message-
 From: Beer, Christian [mailto:[EMAIL PROTECTED]]
 Sent: 15 November 2001 13:14
 To: '[EMAIL PROTECTED]'
 Subject: AW: Difficulties embedding FOP by firing SAX events myself
 
 
 I did it this way:
 
 code
 // FO -- PDF
 driver.reset();
 driver.setOutputStream(pdf);
 driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF);
 
 TransformerFactory tFactory = TransformerFactory.newInstance();
 if (tFactory.getFeature(SAXSource.FEATURE) 
 tFactory.getFeature(SAXResult.FEATURE)) {
   SAXTransformerFactory saxTFactory = 
 ((SAXTransformerFactory)tFactory);
 
   TransformerHandler th = saxTFactory.newTransformerHandler(new
 StreamSource(xsl));
 
   // Create SAXResult based on FOP Driver content handler 
 which will accept
   // SAX events and build FOP tree
   SAXResult saxResult = new SAXResult(driver.getContentHandler());
 
   th.setResult(saxResult);
 comment
 
 Now you can use th as a ContentHandler and fire the events on it!
 
 /comment
   pdf.close();
 }
 /code
 
 Christian
 
 -Ursprüngliche Nachricht-
 Von: Smith, Paul [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 15. November 2001 13:11
 An: Fop-Dev (E-mail)
 Cc: Smith, Paul
 Betreff: Difficulties embedding FOP by firing SAX events myself
 
 
 Hi,
 
 I am trying to embed FOP within my own Java application as 
 described in
 http://xml.apache.org/fop/embedding.html, specifically the 
 third method:
 calling getContentHandler() and firing the SAX events 
 yourself and I am
 running into difficulties!
 
 I have a class called MyParser which fires the required events (it
 implements XMLReader). Its parse method that calls SAX events on
 ContentHandler and ignores the InputStream. If I do:
 (I have simplifed the code samples so their maybe a few typos)
 
   MyParser parser = new MyParser();
   XMLSerializer serializer = new XMLSerializer(new
 FileOutputStream(output.fo), new OutputFormat(method, encoding,
 indenting));
   ContentHandler handler = serializer.asContentHandler();
   parser.setContentHandler(handler);
   parser.parse(new InputStream());
 
 Then I can produce a well formed XSL-FO file that validates 
 against the DTD
 provided by N. Grigoriev from RenderX. Running fop on this 
 file eg. fop
 output.fo output.pdf, generates output.pdf successfully.
 
 HOWEVER, If I try and embed FOP by doing:
 
   Driver driver = new Driver();
   driver.setOutputStream(new FileOutputStream(output.pdf);
   driver.setInputSource(new InputSource());
   Logger logger =
 Hierarchy.getDefaultHierarchy().getLoggerFor(foRender);
   logger.setPriority(Priority.INFO);
   driver.setLogger(logger);
   
   MyParser parser = new MyParser();
   driver.render(parser, new InputSource());
   
 FOP generates output.pdf but when opened in Acrobat Reader I 
 get There was
 an error opening this document. Could not repair file.
 Closer inspection shows that the PDF has not been correctly 
 generated at
 all. The first 9 lines look like:
 
 %PDF-1.3
 %ª«¬­
 4 0 obj
  /Type /Info
 /Producer (null) 
 endobj
 5 0 obj
  /Length 235 /Filter /FlateDecode 
  
 
 where as the first 9 lines of the PDF generated by running 
 FOP from the
 command line look like:
 
 %PDF-1.3
 %ª«¬­
 4 0 obj
  /Type /Info
 /Producer (FOP 0.20.1) 
 endobj
 5 0 obj
  /Length 296 /Filter [ /ASCII85Decode /FlateDecode ]
  
 
 During driver.render the logger prints out:
 
 INFO10058   [foRender] (): building formatting object tree
 DEBUG   10058   [fop ] (): setting up fonts
 INFO10058   [foRender] (): [1]
 
 
 Any help you can offer is much appreciated. Thanks in advance
 
 ---
 Paul Smith
 
 
 ***
 DISCLAIMER: The information contained in this email
  is confidential and is intended solely for the use of the
  named addressee.  Access, copying or re-use of the
  information in it by any other person is not authorised.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]
 


***
DISCLAIMER: The information contained in this email
 is confidential and is intended solely for the use of the
 named addressee.  Access

AW: Embedding fop in IE..Help!!!

2001-10-16 Thread Beer, Christian

What you do is printing CHARACTER data!! Try this:
code
OutputStream os = response.getOutputStream();
os.write(binary-data/);
os.close();
/code

Cheers
Christian

-Ursprüngliche Nachricht-
Von: Rajagopal. V [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 15. Oktober 2001 20:49
An: [EMAIL PROTECTED]
Betreff: Re: Embedding fop in IE..Help!!!


Hi
Im using a JSP to generate this PDF. I am able to open
other Static pdfs.
This is what i do, i create a bytearrayoutputstream
which will hold the output of the render and then use
a 

pageContext.getOut().print(bytearrayoutputstreamobject);

and this results in printing binary content on the
screen.. I assume this is bcoz IE doesnt recognize the
content type and print jst prints it on the screen,
whereas Netscape understands the Content Type and
displays it as a PDF.
I tried to create a servlet which will generate the
PDF(using streams to generate the output) and it works
in IE and Netscape.

Now, is it not possible to render a PDF using
JSP(especially on IE)?? IS there a way?

Thanks
Raj

--- Amit [EMAIL PROTECTED] wrote:
 Can you open other pdf files (via a link in a html
 page) in IE?
 
 
 Rajagopal. V wrote:
 
  Hi All
  I have an XML file which i combine with a XSL to
  generate the FO file and render it. It works fine
 with
  Netscape but im having a tough time with IE. It is
  displaying garbage on teh screen. All i get is
 binary
  characters for the PDF File. I have IE 5.5 Sp1.
 and i
  tried all the workarounds. These are the ones I
 tried
  1) Changed the name of the file to be .pdf so that
 IE
  will look at the extension and treat it as PDF
 
  2) Bloated the file size to be more than 8k so
 that
  there is no buffer problem with IE
 
  3) Downloaded the Fo file generated and ran the fo
  command line and it generates the PDF properly(as
 an
  application). So there is nothing wrong with the
 FO.
 
  IS there any other way to get a PDF on IE? Im not
 sure
  why im getting binary content all over the screen?
 
  Please HElpp...
 
  TIA
  Raj
 
  __
  Do You Yahoo!?
  Make a great connection at Yahoo! Personals.
  http://personals.yahoo.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]
 


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.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]




Re: Embedding fop in IE..Help!!!

2001-10-15 Thread Carmelo Montanez

I take it you are using an application.  Are you sending both text
and binary data at the same time?, are you using the
printWriter? or the getOutputStream method class?, for binary data
you will need the getOutputStream.  I had the same problem
some time ago and sending JUST the binary data solved the problem.

The problem I ran into was the PDF taking the whole screen
and not a portion of it as I wanted to.  Is anyone aware of
how to restrict a a PDF file to a portion of the screen?

Greetings,

Carmelo Montanez

- Original Message - 
From: Rajagopal. V [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 15, 2001 10:45 AM
Subject: Embedding fop in IE..Help!!!


 Hi All
 I have an XML file which i combine with a XSL to
 generate the FO file and render it. It works fine with
 Netscape but im having a tough time with IE. It is
 displaying garbage on teh screen. All i get is binary
 characters for the PDF File. I have IE 5.5 Sp1. and i
 tried all the workarounds. These are the ones I tried
 1) Changed the name of the file to be .pdf so that IE
 will look at the extension and treat it as PDF
 
 2) Bloated the file size to be more than 8k so that
 there is no buffer problem with IE
 
 3) Downloaded the Fo file generated and ran the fo
 command line and it generates the PDF properly(as an
 application). So there is nothing wrong with the FO.
 
 IS there any other way to get a PDF on IE? Im not sure
 why im getting binary content all over the screen?
 
 Please HElpp...
 
 TIA
 Raj
 
 __
 Do You Yahoo!?
 Make a great connection at Yahoo! Personals.
 http://personals.yahoo.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]




RE: Embedding fop in IE..Help!!!

2001-10-15 Thread Stefan Weber

Did you set the proper content type?

response.setContentType(application/pdf);

Stefan

-Original Message-
From: Rajagopal. V [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 15, 2001 4:45 PM
To: [EMAIL PROTECTED]
Subject: Embedding fop in IE..Help!!!


Hi All
I have an XML file which i combine with a XSL to
generate the FO file and render it. It works fine with
Netscape but im having a tough time with IE. It is
displaying garbage on teh screen. All i get is binary
characters for the PDF File. I have IE 5.5 Sp1. and i
tried all the workarounds. These are the ones I tried
1) Changed the name of the file to be .pdf so that IE
will look at the extension and treat it as PDF

2) Bloated the file size to be more than 8k so that
there is no buffer problem with IE

3) Downloaded the Fo file generated and ran the fo
command line and it generates the PDF properly(as an
application). So there is nothing wrong with the FO.

IS there any other way to get a PDF on IE? Im not sure
why im getting binary content all over the screen?

Please HElpp...

TIA
Raj

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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


sitewaerts GmbH
Hebelstraße 15
D-76133 Karlsruhe

Tel: +49 (721) 920 918 0
Fax: +49 (721) 920 918 29
http://www.sitewaerts.de




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




Re: Embedding fop in IE..Help!!!

2001-10-15 Thread Rajagopal. V

Hi
Im using a JSP to generate this PDF. I am able to open
other Static pdfs.
This is what i do, i create a bytearrayoutputstream
which will hold the output of the render and then use
a 

pageContext.getOut().print(bytearrayoutputstreamobject);

and this results in printing binary content on the
screen.. I assume this is bcoz IE doesnt recognize the
content type and print jst prints it on the screen,
whereas Netscape understands the Content Type and
displays it as a PDF.
I tried to create a servlet which will generate the
PDF(using streams to generate the output) and it works
in IE and Netscape.

Now, is it not possible to render a PDF using
JSP(especially on IE)?? IS there a way?

Thanks
Raj

--- Amit [EMAIL PROTECTED] wrote:
 Can you open other pdf files (via a link in a html
 page) in IE?
 
 
 Rajagopal. V wrote:
 
  Hi All
  I have an XML file which i combine with a XSL to
  generate the FO file and render it. It works fine
 with
  Netscape but im having a tough time with IE. It is
  displaying garbage on teh screen. All i get is
 binary
  characters for the PDF File. I have IE 5.5 Sp1.
 and i
  tried all the workarounds. These are the ones I
 tried
  1) Changed the name of the file to be .pdf so that
 IE
  will look at the extension and treat it as PDF
 
  2) Bloated the file size to be more than 8k so
 that
  there is no buffer problem with IE
 
  3) Downloaded the Fo file generated and ran the fo
  command line and it generates the PDF properly(as
 an
  application). So there is nothing wrong with the
 FO.
 
  IS there any other way to get a PDF on IE? Im not
 sure
  why im getting binary content all over the screen?
 
  Please HElpp...
 
  TIA
  Raj
 
  __
  Do You Yahoo!?
  Make a great connection at Yahoo! Personals.
  http://personals.yahoo.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]
 


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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




RE: Embedding fop in IE..Help!!!

2001-10-15 Thread Shkuro, Yuri

I used JSP to stream out PDF files successfully.
What may be happenning in your case is that the
whitespace between %!%  %% is written to the
output stream before you start writing the PDF content.
Try calling clearBuffer() on the output stream first.

YS

-Original Message-
From: Rajagopal. V [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 15, 2001 2:49 PM
To: [EMAIL PROTECTED]
Subject: Re: Embedding fop in IE..Help!!!


Hi
Im using a JSP to generate this PDF. I am able to open
other Static pdfs.
This is what i do, i create a bytearrayoutputstream
which will hold the output of the render and then use
a 

pageContext.getOut().print(bytearrayoutputstreamobject);

and this results in printing binary content on the
screen.. I assume this is bcoz IE doesnt recognize the
content type and print jst prints it on the screen,
whereas Netscape understands the Content Type and
displays it as a PDF.
I tried to create a servlet which will generate the
PDF(using streams to generate the output) and it works
in IE and Netscape.

Now, is it not possible to render a PDF using
JSP(especially on IE)?? IS there a way?

Thanks
Raj

--- Amit [EMAIL PROTECTED] wrote:
 Can you open other pdf files (via a link in a html
 page) in IE?
 
 
 Rajagopal. V wrote:
 
  Hi All
  I have an XML file which i combine with a XSL to
  generate the FO file and render it. It works fine
 with
  Netscape but im having a tough time with IE. It is
  displaying garbage on teh screen. All i get is
 binary
  characters for the PDF File. I have IE 5.5 Sp1.
 and i
  tried all the workarounds. These are the ones I
 tried
  1) Changed the name of the file to be .pdf so that
 IE
  will look at the extension and treat it as PDF
 
  2) Bloated the file size to be more than 8k so
 that
  there is no buffer problem with IE
 
  3) Downloaded the Fo file generated and ran the fo
  command line and it generates the PDF properly(as
 an
  application). So there is nothing wrong with the
 FO.
 
  IS there any other way to get a PDF on IE? Im not
 sure
  why im getting binary content all over the screen?
 
  Please HElpp...
 
  TIA
  Raj
 
  __
  Do You Yahoo!?
  Make a great connection at Yahoo! Personals.
  http://personals.yahoo.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]
 


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.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]




RE: Embedding fop in IE..Help!!!

2001-10-15 Thread Rajagopal. V

Hi
Infact, i use a taglib to do the PDF Rendition, I have
a library written for generating PDFs and it takes the
Format as an attribute like
xml:render format=PDF file=%=xslFile%/ or
xml:render format=HTML file=%=xslFile%/

And in the taglib,  i use it like
pageContext.getOut().print(bytearrayoutputstream);

IF it is a problem with spaces, I guess Netscape
should also not display this

Cheers
Raj

--- Shkuro, Yuri [EMAIL PROTECTED] wrote:
 I used JSP to stream out PDF files successfully.
 What may be happenning in your case is that the
 whitespace between %!%  %% is written to the
 output stream before you start writing the PDF
 content.
 Try calling clearBuffer() on the output stream
 first.
 
 YS
 
 -Original Message-
 From: Rajagopal. V [mailto:[EMAIL PROTECTED]]
 Sent: Monday, October 15, 2001 2:49 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Embedding fop in IE..Help!!!
 
 
 Hi
 Im using a JSP to generate this PDF. I am able to
 open
 other Static pdfs.
 This is what i do, i create a bytearrayoutputstream
 which will hold the output of the render and then
 use
 a 
 

pageContext.getOut().print(bytearrayoutputstreamobject);
 
 and this results in printing binary content on the
 screen.. I assume this is bcoz IE doesnt recognize
 the
 content type and print jst prints it on the screen,
 whereas Netscape understands the Content Type and
 displays it as a PDF.
 I tried to create a servlet which will generate the
 PDF(using streams to generate the output) and it
 works
 in IE and Netscape.
 
 Now, is it not possible to render a PDF using
 JSP(especially on IE)?? IS there a way?
 
 Thanks
 Raj
 
 --- Amit [EMAIL PROTECTED] wrote:
  Can you open other pdf files (via a link in a html
  page) in IE?
  
  
  Rajagopal. V wrote:
  
   Hi All
   I have an XML file which i combine with a XSL to
   generate the FO file and render it. It works
 fine
  with
   Netscape but im having a tough time with IE. It
 is
   displaying garbage on teh screen. All i get is
  binary
   characters for the PDF File. I have IE 5.5 Sp1.
  and i
   tried all the workarounds. These are the ones I
  tried
   1) Changed the name of the file to be .pdf so
 that
  IE
   will look at the extension and treat it as PDF
  
   2) Bloated the file size to be more than 8k so
  that
   there is no buffer problem with IE
  
   3) Downloaded the Fo file generated and ran the
 fo
   command line and it generates the PDF
 properly(as
  an
   application). So there is nothing wrong with the
  FO.
  
   IS there any other way to get a PDF on IE? Im
 not
  sure
   why im getting binary content all over the
 screen?
  
   Please HElpp...
  
   TIA
   Raj
  
  
 __
   Do You Yahoo!?
   Make a great connection at Yahoo! Personals.
   http://personals.yahoo.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]
  
 
 
 __
 Do You Yahoo!?
 Make a great connection at Yahoo! Personals.
 http://personals.yahoo.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]
 


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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




Re: Problem with embedding fop

2001-07-09 Thread adel ben

Hi Martin,

I have tried to add the url-pattern to web.xml and it doesn't work too:((

I would like to add that the sample given with the ditribution of FOP tha
renders fo files with a servlet works wether the call of the servlet is from
IE or Netscape Navigator.

Please help.
with regards,
adel







___
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/



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




Problem with embedding fop

2001-07-06 Thread adel ben

Hi all,
I've tryed to embed FOP-0.18.1DEV with a servlet so that to render (xml,xsl)
files into PDF. I am using Tomcat 3.2.1 as web container. 

Unfortunately, the call of the servlet works from Netscape Navigator 
and renders PDF. However, it doesn't work from Internet Explorer. in fact
with IE, the process ends with a black page in the browser despite the well
processing in Tomcat console ( all debuging info which are displayed with
the netscape call are displayed too with IE call)

you will find attached the servlet code, the xml, xsl file and the html file
which allow to call the servlet.


please help,
Sincerly, adel





___
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/


 PDFGeneratorServlet.java
Title: Afficher PDF

 
 
 
  This is my first page
  To vew PDF, 
  try this link
  	
 

?xml version=1.0?
xsl:stylesheet version=1.0
  xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  xmlns:fo=http://www.w3.org/1999/XSL/Format;

!----
!-- Root Element Template  --
!-- This template specifies what creates the root element of the   --
!-- result tree.  In this case, it tells the XSL processor to  --
!-- start with the letter element.   --
!----

xsl:template match=/
xsl:apply-templates select=content/
  /xsl:template

!----
!-- letter template  --
!-- This template takes the letter element and processes its   --
!-- contents.  --
!----

xsl:template match=/
	xsl:apply-templates select=page/
/xsl:template
xsl:template match=page

!----
!-- Cocoon processing instruction  --
!-- This processing instruction lets us serve an XML document as a --
!-- PDF.  The Cocoon servlet uses this instruction to invoke FOP   --
!-- automatically. --
!----

xsl:processing-instruction 
  name=cocoon-formattype=text/xslfo/xsl:processing-instruction

!----
!-- The fo:root element contains the entire document.  --
!----

fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

!----
!-- The layout-master-set defines a set of page layouts.  For our  --
!-- purposes here, we only need one.   --
!----

  fo:layout-master-set
fo:simple-page-master
  page-master-name=main
  margin-top=75pt
  margin-bottom=75pt
  margin-left=75pt
  margin-right=75pt

!----
!-- The region-body element is where all the action is.  We'll put --
!-- all of our content into this space.--
!----

  fo:region-body margin-bottom=75pt/
/fo:simple-page-master
  /fo:layout-master-set

!----
!-- Our next step is to define the page styles used.  We can   --
!-- different page styles for the first page, odd pages, and even  --
!-- pages.  They're all the same for this simple document. --
!----

  fo:page-sequence
fo:sequence-specification
  fo:sequence-specifier-alternating
page-master-first=main
page-master-odd=main
page-master-even=main/
/fo:sequence-specification

!----
!-- Finally, we'll put everything into a flow element. --
!----

fo:flow

!----
!-- To get the formatting we want, we'll put the content in a block--
!----

 fo:block font-size=12pt line-height=15pt 
  text-align=start space-after.optimum=24pt
  xsl:value-of select=title/  
  xsl:value-of select=content/paragraph/		
 /fo:block
  
/fo:flow
   /fo:page-sequence
  /fo:root
/xsl:template
/xsl:stylesheet


?xml version=1.0 ?
?xml-stylesheet href=hello.xsl type=text/xsl?

Re: Problem with embedding fop

2001-07-06 Thread Bjoern Martin

 Hi all,
 I've tryed to embed FOP-0.18.1DEV with a servlet so that to render
 (xml,xsl) files into PDF. I am using Tomcat 3.2.1 as web container.

 Unfortunately, the call of the servlet works from Netscape Navigator
 and renders PDF. However, it doesn't work from Internet Explorer.
 in fact with IE, the process ends with a black page in the browser
 despite the well processing in Tomcat console ( all debuging info
 which are displayed with the netscape call are displayed too with IE
 call)

You may want to add the suffix 'pdf' to your servlet url pattern 
within the 'web.xml' for your context, e.g.

url-pattern/pdf_out.pdf/url-pattern

I did this for my XML output to make IE display my XML files properly.
It seems IE is not very interested in the content type you set :(

Regards.

--
Bjoern Martin[EMAIL PROTECTED]



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