forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Odlind" <Steve.Odl...@TouchClarity.com>
Subject RE: SVG images not displayed in PDFs using Forrest version 0.8
Date Thu, 11 Jan 2007 16:37:28 GMT
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 a@href) 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:crossley@apache.org] 
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 a@href) for the image
that works for you in 0.7 version?

-David

Mime
View raw message