Hi David, >> Steve can you please try the example: >> my-new-sample >> forrest seed-sample >> forrest run >> http://localhost:8888/samples/linking.html#images >> and the PDF.
>> Then try adding your example. Tell us what happens. My results were the same as yours for version 0.8. Only two images are shown in PDFs: item 4 in the first group and item 3 in the second group. All the images are displayed in HTML. When I added my own examples, <img src="images/anImage.png" alt="PNG image"/> worked as desired (i.e. image displayed in HTML and PDF), but <img src="images/anImage.svg alt="SVG image"/> caused an error message to be shown (see below). >> What is your localhost URI (i.e. the [EMAIL PROTECTED]) for the image >> that works for you in 0.7 version? The localhost URI of an image that does work in version 0.7 is src="../images/anImage.svg" I forgot to mention previously that I had added a new element called <figurepdf>. I can't use SVGs with any effects or colour gradients in PDFs due to some limitations in FOP. Therefore, I use the <figurepdf> element to include SVG images without these effects in PDF only, and use the <figure> element to include images with fancy effects in HTML. This worked fine in version 0.7. However, it seems version 0.8 completely ignores both the <figure> and <figurepdf> elements when it generates the PDF (even though they are included in document-to-fo.xsl). The only way to include an image in the PDF is to use the <img> element. Now that I have changed the <figurepdf> elements to <img> elements I get the following error message when I execute the 'forrest' command (see attachment for the rest of the error message): "" Exception in thread "main" java.lang.NoSuchMethodError: org.apache.batik.bridge. UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/ w3c/dom/Element;)Lorg/apache/batik/util/UnitProcessor$Context; at org.apache.fop.image.analyser.SVGReader.loadImage(SVGReader.java:107) ... "" So, am I right in thinking that the reason SVGs are not displayed in PDFs has something to do with the Batik? Also, why would Forrest ignore the <figure> element in PDFs? If you take a look at http://localhost:8888/samples/sample.html#figure, the image is not displayed in the PDF with the <figure> element, but if you change it to an <img> element it is displayed. This is odd, as both 'figure' and 'img' are matched in the same template in document-to-fo.xsl: "<xsl:template match="figure|img">" Thanks for your help, Steve -----Original Message----- From: David Crossley [mailto:[EMAIL PROTECTED] Sent: 11 January 2007 04:32 To: user@forrest.apache.org Subject: Re: SVG images not displayed in PDFs using Forrest version 0.8 Gav.... wrote: > > Anyway, just confirming, this is also the case with all images > On the published forrest website, no images showing in PDFs. > (png or svg) Not "all" missing. There are some, e.g. in your-project.pdf These seem to be PNGs relative to the document. But yes, others are missing, e.g. in dtdx/document-v20.pdf This seems to be consistent with FOR-635 https://issues.apache.org/jira/browse/FOR-635 > > From: Gav.... > > > From: Steve Odlind > > > > > > PNGs display fine in html and PDF (as long as they are in the > > > resources/images directory). > > > > > > SVG images are not displayed in PDFs, regardless of the directory they > > > are in. I have tried resources/images and xdocs/images. > > > > Well, Having tested this again using > > http://localhost:8888/samples/linking.pdf > > > > It seems you are correct, this wasn't the case before, I remember some of > > The images showing, now none of them are, not even png images appear for > > me On the above page. This is using skins 0.8-dev with only pdf plugin. Are you sure that you have followed the FAQ? http://forrest.apache.org/faq.html#pdf_images > > Perhaps something has changed to make FOR-635 even worse of an issue than > > It once was. This is a quick investigation, I'll look into it more. I investigated this again today. In light of Steve's comments tried the current examples on various past versions of Forrest. The bad behaviour is consistent. Steve can you please try the example: cd my-new-sample forrest seed-sample forrest run http://localhost:8888/samples/linking.html#images and the PDF. Then try adding your example. Tell us what happens. I don't see any of the SVG generated PNGs in the PDF. This is the same for me in various versions, see the comments at https://issues.apache.org/jira/browse/FOR-635 What is your localhost URI (i.e. the [EMAIL PROTECTED]) for the image that works for you in 0.7 version? -David
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.batik.bridge. UnitProcessor.createContext(Lorg/apache/batik/bridge/BridgeContext;Lorg/w3c/dom/ Element;)Lorg/apache/batik/util/UnitProcessor$Context; at org.apache.fop.image.analyser.SVGReader.loadImage(SVGReader.java:107) at org.apache.fop.image.analyser.SVGReader.verifySignature(SVGReader.jav a:85) at org.apache.fop.image.analyser.ImageReaderFactory.Make(ImageReaderFact ory.java:129) at org.apache.fop.image.FopImageFactory.Make(FopImageFactory.java:181) at org.apache.fop.fo.flow.ExternalGraphic.layout(ExternalGraphic.java:18 8) at org.apache.fop.fo.flow.Block.layout(Block.java:257) at org.apache.fop.fo.flow.Block.layout(Block.java:257) at org.apache.fop.fo.flow.ListItemBody.layout(ListItemBody.java:118) at org.apache.fop.fo.flow.ListItem.layout(ListItem.java:203) at org.apache.fop.fo.flow.ListBlock.layout(ListBlock.java:201) at org.apache.fop.fo.flow.Block.layout(Block.java:257) at org.apache.fop.fo.flow.Block.layout(Block.java:257) at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154) at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:110) at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java: 400) at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:33 8) at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223) at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java :111) at org.apache.cocoon.xml.AbstractXMLPipe.endElement(AbstractXMLPipe.java :111) at org.apache.cocoon.xml.xlink.XLinkPipe.endElement(XLinkPipe.java:211) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.cocoon.core.container.handler.PoolableComponentHandler$Pro xyHandler.invoke(PoolableComponentHandler.java:147) at $Proxy5.endElement(Unknown Source) at org.apache.cocoon.environment.internal.EnvironmentChanger.endElement( EnvironmentStack.java:147) at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler. java:261) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResul t.java:1399) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Tr ansformerImpl.java:2411) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResul t.java:1374) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Tr ansformerImpl.java:2411) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Tran sformerImpl.java:2281) at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme rImpl.java:1367) at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java :3458) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(Trans formerHandlerImpl.java:406) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.jav a:55) at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTran sformer.java:585) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.jav a:55) at org.apache.cocoon.transformation.AbstractSAXTransformer.endDocument(A bstractSAXTransformer.java:377) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.jav a:55) at org.apache.cocoon.transformation.XIncludeTransformer$XIncludePipe.end Document(XIncludeTransformer.java:184) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.jav a:55) at org.apache.cocoon.sitemap.DefaultContentAggregator.generate(DefaultCo ntentAggregator.java:135) at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.cocoon.core.container.handler.PoolableComponentHandler$Pro xyHandler.invoke(PoolableComponentHandler.java:147) at $Proxy3.generate(Unknown Source) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.proc essXMLPipeline(AbstractProcessingPipeline.java:537) at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingP ipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:174) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.proc ess(AbstractProcessingPipeline.java:722) at org.apache.cocoon.components.source.impl.SitemapSource.toSAX(SitemapS ource.java:347) at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java: 97) at org.apache.cocoon.components.source.SourceUtil.parse(SourceUtil.java: 276) at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.jav a:118) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.proc essXMLPipeline(AbstractProcessingPipeline.java:530) at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingP ipeline.processXMLPipeline(AbstractCachingProcessingPipeline.java:174) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.proc ess(AbstractProcessingPipeline.java:437) at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invo ke(SerializeNode.java:137) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.SelectNode.invoke( SelectNode.java:86) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:55) at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNod e.invoke(PreparableMatchNode.java:116) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invok e(PipelineNode.java:155) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invo ke(PipelinesNode.java:95) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.proc ess(ConcreteTreeProcessor.java:292) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.proc ess(ConcreteTreeProcessor.java:223) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(Tree Processor.java:289) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(M ountNode.java:114) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.SelectNode.invoke( SelectNode.java:81) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invok e(PipelineNode.java:155) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invo ke(PipelinesNode.java:95) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.proc ess(ConcreteTreeProcessor.java:292) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.proc ess(ConcreteTreeProcessor.java:223) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(Tree Processor.java:289) at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(M ountNode.java:114) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.SelectNode.invoke( SelectNode.java:81) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invok e(PipelineNode.java:155) at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNo de.invokeNodes(AbstractParentProcessingNode.java:77) at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invo ke(PipelinesNode.java:95) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.proc ess(ConcreteTreeProcessor.java:292) at org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.proc ess(ConcreteTreeProcessor.java:223) at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(Tree Processor.java:289) at org.apache.cocoon.Cocoon.process(Cocoon.java:557) at org.apache.cocoon.bean.CocoonWrapper.getPage(CocoonWrapper.java:426) at org.apache.cocoon.bean.CocoonBean.processTarget(CocoonBean.java:496) at org.apache.cocoon.bean.CocoonBean.process(CocoonBean.java:357) at org.apache.cocoon.Main.main(Main.java:311)