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: 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 the run statements File userConfigFile = new File( "userconfig.xml" ); org.apache.fop.apps.Options options = new