Re: Creating PDF with graphics

2002-10-25 Thread Ralph Seidl
Hi Michael,

J.Pietschmann is right, I also had trouble with the batik and fop jars.
The jar-Files I use now:

fop.jar (V20.4) 1.694.560 Bytes
batik.jar (from fop V20.4) 2.163.538 Bytes

I'm using: 
cocoon 2.0.3 
tomcat 4.0.4
jdk 1.3.1

under NT 4.0 and Solaris (under Solaris I use the PJA-Toolkit because I
have no X-Windows on this server)

If you use this jars and you get no java.lang.NoClassDefFoundError I
guess my original code should work

Hope this helps,

Ralph

[EMAIL PROTECTED] wrote:
 
 Ralph, many thanks, this is, what I expected. If it works, I only have to
 add svg: to the graphics tag. But it currently doesn't work. The result
 is a broken PDF output - only about the 10 first bytes from the PDF. I
 played a bit with your code and I found, that the line svg:svg ...
 (closed with the matching end tag) killed the PDF creation.
 
  fo:block
fo:instream-foreign-object
  svg:svg width=150mm height=10mm
  /svg:svg
/fo:instream-foreign-object
  /fo:block
 
 As you can see, I replaced the 800.0 and 8.0 values, because I got a
 error message about a missing transformation parameter or so. After doing
 this, the last log entry in catalina.out, that seems to be written in
 the case of the svg:svg block, is:
 
 java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/DefaultSVGContext
 
 I wonder about this, because the SVG-Demo from Cocoon works fine and
 contains similar code as yours.
 
 Do I have to reconfigure anything or install something? I installed the
 normal Cocoon 2.0.3 package and Tomcat 4.1.8 on a Linux box. There is a
 package batik-all-1.5b2.jar installed in the cocoon lib-directory. I
 didn't understand what's wrong. I use the J2SDK 1.4.0 from the Sun site ;-
 ).
 
 Meanwhile, I read some docs about instream-foreign-object and found,
 that your code looks 100% correct. So I assume it's my mistake.
 
 Other messages here in the list are also about
 a java.lang.NoClassDefFoundError, but for other classes. It looks like a
 typical configuration- oder dependency problem. But I found no solution
 anywhere.
 
 Any suggestion?
 
 [EMAIL PROTECTED] wrote at
 Thu, 24 Oct 2002 17:36:21 +0200:
 
 Hi,
 
 try something like
 
  fo:block
fo:instream-foreign-object
  svg:svg xmlns:svg=http://www.w3.org/2000/svg; width=800.0
 height=8.0
svg:g style=stroke:#00; stroke-width:1.0
  svg:line x1=2.0 y1=2.0 x2=794.0 y2=2.0/
/svg:g
  /svg:svg
/fo:instream-foreign-object
  /fo:block
 
 If you are looking for examples take a look at the batik-project also
 from apache ( http://xml.apache.org/batik ).
 
 Michael Fridrich


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics

2002-10-25 Thread michael . fridrich
Many thanks,

this sounds very good, I will try this.

Greetings,
Michael.


[EMAIL PROTECTED] wrote at 
Thu, 24 Oct 2002 23:59:59 +0200:

[EMAIL PROTECTED] wrote:
 
 java.lang.NoClassDefFoundError: 
org/apache/batik/dom/svg/DefaultSVGContext
 
There were Cocoon versions which included a Batik version
incompatible with the distributed FOP version. Get the
most recent FOP release (0.20.4) and replace both the fop.jar
and batik.jar form Cocoon with the jars from the FOP distro.
This may impede your ability to use the svg2png and svg2jpeg
serializers though, so keep a backup of the batik.jar from
Cocoon.



Michael Fridrich


http://michael-fridrich.piranho.com/


-- Info -
Sind Sie bei einer guenstigen Krankenversicherung versichert? 
Hier finden Sie einen Vergleich privater Krankenversicherungen
fuer diverse Berufsgruppen erwartet Sie hier:
http://partners.webmasterplan.com/click.asp?ref=128254site=1387type=texttnb=2


-
*** sent through http://www.everymail.net FREE e-mail 
 

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics / Batik / NoClassDefFoundError

2002-10-25 Thread michael . fridrich
Many thanks to all!

I'v downloaded the fop-0.20.4 package and extracted fop and batik to the 
cocoon lib-directory and it works fine.

What's about a official sample for Cocoon that demonstrates the PDF with 
embedded graphics feature (or at least for Cocoon testing)? If I have 
more expierience with Cocoon, I may create such sample - if there is not 
an real expert who wish to do this. Who should be contacted for this idea?

My current configuration:

Tomcat 4.1.8
Cocoon 2.0.3
J2SDK 1.4.0 from Sun
-- replaced in */tomcat4/webapps/cocoon/WEB-INF/lib/
fop-0.20.3.jar by fop-0.20.4.jar
batik-all-1.5b2.jar by batik from the fop-package 0.20.4 as batik.jar
--
Running uppon Linux on a Intel box


Greetings and many thanks again,
Michael.

PS: Is there anyone who knows the Cocoon packager, to ask him to correct 
this problem? I spent nearly 3 days for it and I assume, I'm not the first 
one.



Hi Michael,

J.Pietschmann is right, I also had trouble with the batik and fop jars.
The jar-Files I use now:

fop.jar (V20.4) 1.694.560 Bytes
batik.jar (from fop V20.4) 2.163.538 Bytes





Michael Fridrich


http://michael-fridrich.piranho.com/


-- Info -
Sind Sie bei einer guenstigen Krankenversicherung versichert? 
Hier finden Sie einen Vergleich privater Krankenversicherungen
fuer diverse Berufsgruppen erwartet Sie hier:
http://partners.webmasterplan.com/click.asp?ref=128254site=1387type=texttnb=2


-
*** sent through http://www.everymail.net FREE e-mail 
 

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Creating PDF with graphics

2002-10-24 Thread michael . fridrich

I'v seen the Cocoon2 samples after installing a fresh 2.0.3 
Cocoon. There are two interesting samples for me, one 
generates a PDF with a text and one generates a text in a 
graphics format (SVG).

Is it possible, to combine both, to generate PDF's 
containing text /and/ graphics?
If so, is there any sample out there?




Michael Fridrich


http://michael-fridrich.piranho.com/


-- Info -
Sind Sie bei einer guenstigen Krankenversicherung versichert? 
Hier finden Sie einen Vergleich privater Krankenversicherungen
fuer diverse Berufsgruppen erwartet Sie hier:
http://partners.webmasterplan.com/click.asp?ref=128254site=1387type=texttnb=2


-
*** sent through http://www.everymail.net FREE e-mail 
 

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics

2002-10-24 Thread Bert Van Kets
Yes, you can combine both.  Use xsl:fo to insert the image, but make sure 
you call it by using the absolute URL (including http://domain/...)
All you need to do then is create a pipeline that generates the image when 
requesting it.

HTH,
Bert


At 15:37 24/10/2002 +0200, you wrote:

I'v seen the Cocoon2 samples after installing a fresh 2.0.3
Cocoon. There are two interesting samples for me, one
generates a PDF with a text and one generates a text in a
graphics format (SVG).

Is it possible, to combine both, to generate PDF's
containing text /and/ graphics?
If so, is there any sample out there?




Michael Fridrich


http://michael-fridrich.piranho.com/


-- Info -
Sind Sie bei einer guenstigen Krankenversicherung versichert?
Hier finden Sie einen Vergleich privater Krankenversicherungen
fuer diverse Berufsgruppen erwartet Sie hier:
http://partners.webmasterplan.com/click.asp?ref=128254site=1387type=texttnb=2


-
*** sent through http://www.everymail.net FREE e-mail


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics

2002-10-24 Thread michael . fridrich
Bert, a good idea, using graphics from an external source. 
I think, I will use it too. But what I need is a way to 
draw graphics (like the SVG-sample) inside my text 
document, to draw fancy borders or other layout elements.

SVG seems to be good for this, the SVG sample is 
impressive! I found some good looking SVG samples in the 
net. But I don't know, how to include the SVG elements into 
my stylesheet or whereever, to make them appear in the PDF 
result.

Are there any samples for Cocoon where I can learn how to 
do this? I'm almost new to Cocoon, so I think, sample files 
or applications will be the best to learn how this works.





[EMAIL PROTECTED] wrote at 
Thu, 24 Oct 2002 15:57:44 +0200:

Yes, you can combine both.  Use xsl:fo to insert the 
image, but make sure 
you call it by using the absolute URL (including 
http://domain/...)
All you need to do then is create a pipeline that 
generates the image when 
requesting it.



Michael Fridrich


http://michael-fridrich.piranho.com/


-- Info -
Sind Sie bei einer guenstigen Krankenversicherung versichert? 
Hier finden Sie einen Vergleich privater Krankenversicherungen
fuer diverse Berufsgruppen erwartet Sie hier:
http://partners.webmasterplan.com/click.asp?ref=128254site=1387type=texttnb=2


-
*** sent through http://www.everymail.net FREE e-mail 
 

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics

2002-10-24 Thread Bert Van Kets
You should do 3 things:
1. Check the PDF docs and see if it understands SVG.  If so, send SVG and 
not a bitmap.  The quality of teh image will be better
2. Check out the SVG docs at http://www.w3.org/Graphics/SVG/Overview.htm8 
to see how you create SVG docs.
3. Check the xsl:fo documentation 
http://www.antennahouse.com/XSLsample/XSLsample.htm to see how you need to 
create an xsl:fo document

The absolute URL is needed to get FOP to import the image.  It has nothing 
to do with an external source or not, just that this is a bug in FOP!

Unfortunately there are no samples in Cocoon where a PDF contains 
dynamically generated images.

Bert


At 16:33 24/10/2002 +0200, you wrote:
Bert, a good idea, using graphics from an external source.
I think, I will use it too. But what I need is a way to
draw graphics (like the SVG-sample) inside my text
document, to draw fancy borders or other layout elements.

SVG seems to be good for this, the SVG sample is
impressive! I found some good looking SVG samples in the
net. But I don't know, how to include the SVG elements into
my stylesheet or whereever, to make them appear in the PDF
result.

Are there any samples for Cocoon where I can learn how to
do this? I'm almost new to Cocoon, so I think, sample files
or applications will be the best to learn how this works.





[EMAIL PROTECTED] wrote at
Thu, 24 Oct 2002 15:57:44 +0200:

Yes, you can combine both.  Use xsl:fo to insert the
image, but make sure
you call it by using the absolute URL (including
http://domain/...)
All you need to do then is create a pipeline that
generates the image when
requesting it.



Michael Fridrich


http://michael-fridrich.piranho.com/


-- Info -
Sind Sie bei einer guenstigen Krankenversicherung versichert?
Hier finden Sie einen Vergleich privater Krankenversicherungen
fuer diverse Berufsgruppen erwartet Sie hier:
http://partners.webmasterplan.com/click.asp?ref=128254site=1387type=texttnb=2


-
*** sent through http://www.everymail.net FREE e-mail


-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics

2002-10-24 Thread michael . fridrich

Bert, many thanks for the links. They are very usefull. Looks like others 
have already solved the problem.

Michael


[EMAIL PROTECTED] wrote at 
Thu, 24 Oct 2002 16:55:56 +0200:

2. Check out the SVG docs at http://www.w3.org/Graphics/SVG/Overview.htm8 
to see how you create SVG docs.
3. Check the xsl:fo documentation 
http://www.antennahouse.com/XSLsample/XSLsample.htm to see how you need 
to 



Michael Fridrich


http://michael-fridrich.piranho.com/


-- Info -
Sind Sie bei einer guenstigen Krankenversicherung versichert? 
Hier finden Sie einen Vergleich privater Krankenversicherungen
fuer diverse Berufsgruppen erwartet Sie hier:
http://partners.webmasterplan.com/click.asp?ref=128254site=1387type=texttnb=2


-
*** sent through http://www.everymail.net FREE e-mail 
 

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics

2002-10-24 Thread michael . fridrich
Ralph, many thanks, this is, what I expected. If it works, I only have to 
add svg: to the graphics tag. But it currently doesn't work. The result 
is a broken PDF output - only about the 10 first bytes from the PDF. I 
played a bit with your code and I found, that the line svg:svg ... 
(closed with the matching end tag) killed the PDF creation.

 fo:block
   fo:instream-foreign-object
 svg:svg width=150mm height=10mm
 /svg:svg
   /fo:instream-foreign-object
 /fo:block

As you can see, I replaced the 800.0 and 8.0 values, because I got a 
error message about a missing transformation parameter or so. After doing 
this, the last log entry in catalina.out, that seems to be written in 
the case of the svg:svg block, is:


java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/DefaultSVGContext


I wonder about this, because the SVG-Demo from Cocoon works fine and 
contains similar code as yours.

Do I have to reconfigure anything or install something? I installed the 
normal Cocoon 2.0.3 package and Tomcat 4.1.8 on a Linux box. There is a 
package batik-all-1.5b2.jar installed in the cocoon lib-directory. I 
didn't understand what's wrong. I use the J2SDK 1.4.0 from the Sun site ;-
).


Meanwhile, I read some docs about instream-foreign-object and found, 
that your code looks 100% correct. So I assume it's my mistake.

Other messages here in the list are also about 
a java.lang.NoClassDefFoundError, but for other classes. It looks like a 
typical configuration- oder dependency problem. But I found no solution 
anywhere.


Any suggestion?




[EMAIL PROTECTED] wrote at 
Thu, 24 Oct 2002 17:36:21 +0200:

Hi,

try something like

 fo:block
   fo:instream-foreign-object
 svg:svg xmlns:svg=http://www.w3.org/2000/svg; width=800.0
height=8.0
   svg:g style=stroke:#00; stroke-width:1.0
 svg:line x1=2.0 y1=2.0 x2=794.0 y2=2.0/
   /svg:g
 /svg:svg
   /fo:instream-foreign-object
 /fo:block

If you are looking for examples take a look at the batik-project also
from apache ( http://xml.apache.org/batik ).



Michael Fridrich


http://michael-fridrich.piranho.com/


-- Info -
Sind Sie bei einer guenstigen Krankenversicherung versichert? 
Hier finden Sie einen Vergleich privater Krankenversicherungen
fuer diverse Berufsgruppen erwartet Sie hier:
http://partners.webmasterplan.com/click.asp?ref=128254site=1387type=texttnb=2


-
*** sent through http://www.everymail.net FREE e-mail 
 

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics

2002-10-24 Thread Ralph Seidl
Hi,

try something like

 fo:block
   fo:instream-foreign-object
 svg:svg xmlns:svg=http://www.w3.org/2000/svg; width=800.0
height=8.0
   svg:g style=stroke:#00; stroke-width:1.0
 svg:line x1=2.0 y1=2.0 x2=794.0 y2=2.0/
   /svg:g
 /svg:svg
   /fo:instream-foreign-object
 /fo:block

If you are looking for examples take a look at the batik-project also
from apache ( http://xml.apache.org/batik ).

Greetings,

Ralph

Ryan Agler wrote:
 
 If you set up your sitemap right, you can pull this off (well, most of
 it, not sure how you would do borders). First, you want to create
 pipelines for the images you want to create:
 
 map:match pattern=*.dynamic.jpeg
map:generate type=serverpages src=svgData/{1}.xsp /
map:transform src=svgSheets/{1}.xsl /
map:serialize type=svg2jpeg/
 /map:match
 
 Then, in your fo: stylesheet --
 
 fo:external-graphic src=http://www.mysite.com/pic1.dynamic.jpeg/
 fo:external-graphic src=http://www.mysite.com/pic2.dynamic.jpeg/
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:michael.fridrich;everymail.net]
 Sent: Thursday, October 24, 2002 10:34 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Creating PDF with graphics
 
 Bert, a good idea, using graphics from an external source.
 I think, I will use it too. But what I need is a way to
 draw graphics (like the SVG-sample) inside my text
 document, to draw fancy borders or other layout elements.
 
 SVG seems to be good for this, the SVG sample is
 impressive! I found some good looking SVG samples in the
 net. But I don't know, how to include the SVG elements into
 my stylesheet or whereever, to make them appear in the PDF
 result.
 
 Are there any samples for Cocoon where I can learn how to
 do this? I'm almost new to Cocoon, so I think, sample files
 or applications will be the best to learn how this works.
 
 -
 Please check that your question  has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faq/index.html
 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail:   [EMAIL PROTECTED]

-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




RE: Creating PDF with graphics

2002-10-24 Thread Ryan Agler
If you set up your sitemap right, you can pull this off (well, most of
it, not sure how you would do borders). First, you want to create
pipelines for the images you want to create:

map:match pattern=*.dynamic.jpeg
   map:generate type=serverpages src=svgData/{1}.xsp /
   map:transform src=svgSheets/{1}.xsl /
   map:serialize type=svg2jpeg/
/map:match

Then, in your fo: stylesheet --

fo:external-graphic src=http://www.mysite.com/pic1.dynamic.jpeg/
fo:external-graphic src=http://www.mysite.com/pic2.dynamic.jpeg/


-Original Message-
From: [EMAIL PROTECTED]
[mailto:michael.fridrich;everymail.net] 
Sent: Thursday, October 24, 2002 10:34 AM
To: [EMAIL PROTECTED]
Subject: Re: Creating PDF with graphics

Bert, a good idea, using graphics from an external source. 
I think, I will use it too. But what I need is a way to 
draw graphics (like the SVG-sample) inside my text 
document, to draw fancy borders or other layout elements.

SVG seems to be good for this, the SVG sample is 
impressive! I found some good looking SVG samples in the 
net. But I don't know, how to include the SVG elements into 
my stylesheet or whereever, to make them appear in the PDF 
result.

Are there any samples for Cocoon where I can learn how to 
do this? I'm almost new to Cocoon, so I think, sample files 
or applications will be the best to learn how this works.





-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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




Re: Creating PDF with graphics

2002-10-24 Thread J.Pietschmann
[EMAIL PROTECTED] wrote:


java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/DefaultSVGContext


There were Cocoon versions which included a Batik version
incompatible with the distributed FOP version. Get the
most recent FOP release (0.20.4) and replace both the fop.jar
and batik.jar form Cocoon with the jars from the FOP distro.
This may impede your ability to use the svg2png and svg2jpeg
serializers though, so keep a backup of the batik.jar from
Cocoon.


Furthermore, it is often easier to develop with the FOP
command line application first and move to Cocoon later.
One reason is, you don't have to search through a bunch
of logs for problems...

J.Pietschmann



-
Please check that your question  has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faq/index.html

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