You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Juan Jose Pablos <ch...@che-che.com> on 2003/05/24 17:39:17 UTC

Cocoon 2.1M2 works! but pdf images does not.

I download the lastest version from cvs, and I am able to build my site
with this version. Thanks Jeff!!!!

I thought that this version fixed the images on the pdf documents, but
it does not seem to work.

I read the doc on  etc/get_fop_images.sh.

I asumed that cocoon-20030311.jar cocoon-fop-block-20030311.jar have
been replaced by the lastest version of cocoon.

I added jimi.jar on the directory and use the fop-20030320.jar, but with
not luck.

Is there anything else I need to do?

Thank you!

Cheche


Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Jeff Turner dijo:
> Oh, yes.  PNGs generated from SVG won't work in PDFs.  This is because
> FOP 0.20.x has no knowledge of how to query internal Cocoon pipelines,
> so it cannot render dynamically generated images.

Thanks for your answer,

Damn! ;) This was always my problem. Sorry for the posting to the list. I
will try to address this issue as I can,
>
> Keiron wrote a patch which gets CVS FOP (trunk) working with Cocoon, and
>  should solve the dynamic images problem.  However I don't know how
> usable CVS FOP is currently.  If you want to try that, it would be
> easiest to download Cocoon M2, apply Keiron's patch (in bugzilla
> somewhere) and try with Forrest with a fop.jar built from CVS.

I will try to use it and forward the experience to the list.

Antonio Gallardo.




Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Jeff Turner wrote:
> Keiron wrote a patch which gets CVS FOP (trunk) working with Cocoon, and 
> should solve the dynamic images problem.  However I don't know how 
> usable CVS FOP is currently.

CVS HEAD has severe bugs. It might work but anything more
complicated than left aligned plain text may result in
wrong layout or outright crashing. Don;t expect this to
be fixed soon.

J.Pietschmann



Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Jeff Turner <je...@apache.org>.
Antonio Gallardo wrote:
> Jeff Turner dijo:
> 
>>Are you sure you don't have any old jars in Forrest or your classpath?
>>Are there any errors in the Cocoon logs? (well there are usually, but
>>*unusual* errors;)
> 
> 
> Yes. I have not nothing old. I made a build.sh clean before rebuild the
> dist of forrest. Of course before all this i also update the CVS.
> 
> I am also sure there is the jimi.jar file.
> 
> But.... can be the a problem PNG generated from SVG? This is my case. I
> also noted that in the forrest website. In the examples there is not any
> PNG into a PDF.

Oh, yes.  PNGs generated from SVG won't work in PDFs.  This is because 
FOP 0.20.x has no knowledge of how to query internal Cocoon pipelines, 
so it cannot render dynamically generated images.

Keiron wrote a patch which gets CVS FOP (trunk) working with Cocoon, and 
should solve the dynamic images problem.  However I don't know how 
usable CVS FOP is currently.  If you want to try that, it would be 
easiest to download Cocoon M2, apply Keiron's patch (in bugzilla 
somewhere) and try with Forrest with a fop.jar built from CVS.


--Jeff

> 
> Please help me. :)
> 
> Best Regards,
> 
> Antonio Gallardo
> 
> 
> 



Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Jeff Turner dijo:
> Are you sure you don't have any old jars in Forrest or your classpath?
> Are there any errors in the Cocoon logs? (well there are usually, but
> *unusual* errors;)

Yes. I have not nothing old. I made a build.sh clean before rebuild the
dist of forrest. Of course before all this i also update the CVS.

I am also sure there is the jimi.jar file.

But.... can be the a problem PNG generated from SVG? This is my case. I
also noted that in the forrest website. In the examples there is not any
PNG into a PDF.

Please help me. :)

Best Regards,

Antonio Gallardo



Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Jeff Turner <je...@apache.org>.
Antonio Gallardo wrote:
> Jeff Turner dijo:
> 
>>To get images in PDFs, just copy jimi.jar to lib/core and rebuild.  That
>>should be all that's necessary.
>>
>>I've added this to the FAQ.
>>
> 
> Hi: I follow all the instructions and image rendering into PDF still does
> not work.
> 
> the file must be renamed to jimi-1.0.jar.?

Anything with a .jar extension.  The process is now online at:

http://xml.apache.org/forrest/faq.html#pdf_images

Are you sure you don't have any old jars in Forrest or your classpath?
Are there any errors in the Cocoon logs? (well there are usually, but 
*unusual* errors;)

--Jeff

> Best Regards,
> 
> Antonio Gallardo
> 
> 
> 



Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Jeff Turner dijo:
>
> To get images in PDFs, just copy jimi.jar to lib/core and rebuild.  That
> should be all that's necessary.
>
> I've added this to the FAQ.
>
Hi: I follow all the instructions and image rendering into PDF still does
not work.

the file must be renamed to jimi-1.0.jar.?

Best Regards,

Antonio Gallardo



Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Juan Jose Pablos <ch...@che-che.com>.
Jeff,

I found the problem

1) when I was testing the pdf_with_images revision, that tag was left on 
my local copy for the lib/core directory.  i had to remove the lib/core 
directory to fix it. So then all the java errors were gone!

2) The images on the pdf for the sdocbook still does not display on the 
pdf output.


This is the previous xml now on doc-v11 as displayed for the localhost
<document>
<header>
<title>test page for pdf under sdocbook format</title>
<authors/>
</header>
<body>
<section id="Section+test+">
<title>Section test </title>
<p>This test should display a forrest logo below</p>
<table>
<tr>
<td>Forrest Logo </td>
</tr>
<title>Forrest Logo </title>
<mediaobject>
<imageobject>
<tr>
<td>
<img alt="" src="images/forrest-credit-logo.png"/>
</td>
</tr>
</imageobject>
</mediaobject>
</table>
</section>
</body>
</document>

<mediaobject> and <imageobject> are not valid doc-v11 documents!!

The problem is that docbook spec is diferent:

<graphic fileref="images/forrest-credit-logo.png"/>


Than in sdocbook:
<figure>
   <title>Forrest Logo </title>
   <mediaobject>
     <imageobject>
       <imagedata fileref="images/forrest-credit-logo.png" />
     </imageobject>
   </mediaobject>
</figure>


I fixed this for the sdocbook but breaks the docbook format:

Index: docbook2document.xsl
===================================================================
RCS file: 
/home/cvspublic/xml-forrest/src/resources/stylesheets/docbook2document.xsl,v
retrieving revision 1.7
diff -r1.7 docbook2document.xsl
62a63
 >                          <xsl:apply-templates select="title"/>
449c450
<                   <xsl:apply-templates/>
---
 >                   <xsl:apply-templates 
select="mediaobject/imageobject/imagedata"/>


Can we copy docbook2document.xsl to sdocbook2document.xsl apply this fix 
and change the xmap?


Index: forrest.xmap
===================================================================
RCS file: /home/cvspublic/xml-forrest/src/resources/conf/forrest.xmap,v
retrieving revision 1.15
diff -r1.15 forrest.xmap
128c128
<             <map:transform 
src="resources/stylesheets/docbook2document.xsl" />
---
 >             <map:transform 
src="resources/stylesheets/sdocbook2document.xsl" />


I can remove the non-sdocbook elements from this new file if you want.

Thank you,

Cheche


Jeff Turner wrote:
> Juan Jose Pablos wrote:
> 
>> Jeff,
>> I am sorry to ruin your announced..
>>
>>> To get images in PDFs, just copy jimi.jar to lib/core and rebuild.  That
>>> should be all that's necessary.
>>
>>
>> That was the first thing I did, but with not luck, I did some test 
>> today, and the display of images display when you use a 
>> document-v11.dtd format works fine.
>>
>> Now the problem I got is the I use the sdocbook format. This is the 
>> file I use for the test
> 
> ...
> 
>> and this is the error I got:
>>
>>
>> 15:19:49.534 WARN!! Error for /testpdf2.pdf
>> java.lang.NoSuchMethodError: 
>> org.apache.fop.apps.Driver.setLogger(Lorg/apache/avalon/framework/logger/Logger;)V 
> 
> 
> ...
> 
>> 16:14:12.301 WARN!! Error for /testpdf2.pdf
>> java.lang.NoClassDefFoundError: org/apache/fop/messaging/MessageHandler
> 
> ...
> 
> It looks very much like you're missing the fop-0.20.4.jar file, which 
> contains this class. Have you tried to upgrade to CVS FOP recently? Are 
> you sure the doc-v11 PDF images work in the same Forrest installation 
> that sdocbook breaks in?  If so, what does the doc-v11 generated from 
> the sdocbook look like?  Eg., if 'index.html' is rendered from sdocbook, 
> request http://localhost:8888/index.xml, which will return doc-v11).
> 
> 
> --Jeff
> 
>> PLease let me know if you want me to test something else, no problem.
>>
>> Cheers
>>
>> Cheche
>>
>>
> 



Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Jeff Turner <je...@apache.org>.
Juan Jose Pablos wrote:

> Jeff,
> I am sorry to ruin your announced..
> 
>> To get images in PDFs, just copy jimi.jar to lib/core and rebuild.  That
>> should be all that's necessary.
> 
> That was the first thing I did, but with not luck, I did some test 
> today, and the display of images display when you use a document-v11.dtd 
> format works fine.
> 
> Now the problem I got is the I use the sdocbook format. This is the file 
> I use for the test
...
> and this is the error I got:
> 
> 
> 15:19:49.534 WARN!! Error for /testpdf2.pdf
> java.lang.NoSuchMethodError: 
> org.apache.fop.apps.Driver.setLogger(Lorg/apache/avalon/framework/logger/Logger;)V 
...
> 16:14:12.301 WARN!! Error for /testpdf2.pdf
> java.lang.NoClassDefFoundError: org/apache/fop/messaging/MessageHandler
...

It looks very much like you're missing the fop-0.20.4.jar file, which 
contains this class. Have you tried to upgrade to CVS FOP recently? Are 
you sure the doc-v11 PDF images work in the same Forrest installation 
that sdocbook breaks in?  If so, what does the doc-v11 generated from 
the sdocbook look like?  Eg., if 'index.html' is rendered from sdocbook, 
request http://localhost:8888/index.xml, which will return doc-v11).


--Jeff

> PLease let me know if you want me to test something else, no problem.
> 
> Cheers
> 
> Cheche
> 
> 



Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Juan Jose Pablos <ch...@che-che.com>.
Jeff,
I am sorry to ruin your announced..

> To get images in PDFs, just copy jimi.jar to lib/core and rebuild.  That
> should be all that's necessary.
That was the first thing I did, but with not luck, I did some test 
today, and the display of images display when you use a document-v11.dtd 
format works fine.

Now the problem I got is the I use the sdocbook format. This is the file 
I use for the test

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.0//EN"
"http://www.oasis-open.org/docbook/xml/simple/1.0/sdocbook.dtd">
<article>
   <section>
     <title>Test for displaying images on sdocbook format</title>

     <figure>
       <title>figure title</title>

       <mediaobject>
         <imageobject>
           <imagedata fileref="images/forrest-credit-logo.png" />
         </imageobject>
       </mediaobject>
     </figure>
   </section>
</article>

and this is the error I got:


15:19:49.534 WARN!! Error for /testpdf2.pdf
java.lang.NoSuchMethodError: 
org.apache.fop.apps.Driver.setLogger(Lorg/apache/avalon/framework/logger/Logger;)V
	at 
org.apache.cocoon.serialization.FOPSerializer.setOutputStream(FOPSerializer.java:253)
	at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.processXMLPipeline(AbstractProcessingPipeline.java:534)
	at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:217)
	at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:489)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:150)

... remove for better reading


I check that method, and it does exist on the maintence build. Are we 
mixing versions?

I realize than there is the two jars for the distribution, is this
right?

When I remove the old one "fop-0.20.4.jar", I got this error:


16:14:12.301 WARN!! Error for /testpdf2.pdf
java.lang.NoClassDefFoundError: org/apache/fop/messaging/MessageHandler
	at 
org.apache.cocoon.serialization.FOPSerializer.configure(FOPSerializer.java:148)
	at 
org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.java:239)
	at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:315)
	at 
org.apache.avalon.excalibur.pool.ResourceLimitingPool.newPoolable(ResourceLimitingPool.java:672)
	at 
org.apache.avalon.excalibur.pool.ResourceLimitingPool.get(ResourceLimitingPool.java:402)
	at 
org.apache.avalon.excalibur.component.PoolableComponentHandler.doGet(PoolableComponentHandler.java:231)
	at 
org.apache.avalon.excalibur.component.ComponentHandler.get(ComponentHandler.java:408)
	at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.select(ExcaliburComponentSelector.java:244)
	at 
org.apache.cocoon.components.ExtendedComponentSelector.select(ExtendedComponentSelector.java:299)
	at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setSerializer(AbstractProcessingPipeline.java:315)
	at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setSerializer(AbstractCachingProcessingPipeline.java:198)
	at 
org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:133)




PLease let me know if you want me to test something else, no problem.

Cheers

Cheche


Re: Cocoon 2.1M2 works! but pdf images does not.

Posted by Jeff Turner <je...@apache.org>.
On Sat, May 24, 2003 at 05:39:17PM +0200, Juan Jose Pablos wrote:
> I download the lastest version from cvs, and I am able to build my site
> with this version. Thanks Jeff!!!!

I should have announced the upgrade on the list.  Oh well, everyone knows
now..

> I thought that this version fixed the images on the pdf documents, but
> it does not seem to work.
> 
> I read the doc on  etc/get_fop_images.sh.

Sorry, that doc is out of date.  It describes how to use the trunk
version of FOP with Forrest.

To get images in PDFs, just copy jimi.jar to lib/core and rebuild.  That
should be all that's necessary.

I've added this to the FAQ.

--Jeff

> 
> Cheche
>