You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Aaron Optimizer Digulla <di...@hepe.com> on 2001/01/17 13:38:21 UTC

Re: [BUG] using svg created by batik

On Wed, Jan 17, 2001 at 01:27:20PM +0100, Carsten Karkola wrote:

> Hello,
> 
> I created a sample svg with batik's TestSVGGen - see test2.svg
> I made a copy (see test.svg) and added the namesapce svg:
> In the xsl-file i included both files and I've copied the contents of 
> test2.svg manually in the xsl-file.
> The copy and the modified svg-file are properly formated, but the 
> original test2.svg from batik isn't included (Result: test.pdf) ???
> 
> I use fop 0.16 and xalan and xerces of the xalan 1.2.2 binary 
> distribution and the command:
>   java org.apache.fop.apps.XalanCommandLine \
>          test.xml test.xsl test.pdf
> (there are only warnings about some svg-properties - 2 x 5 
> warnings, it seems that the test2.svg isn't included).

There seems to be a strange bug in FOP which prevents SVGs with
a certain format from being included. Here are two common
mistakes:

- The elements are in the wrong namespace (you will see
strange "WARNING: unknown element ^svg" and the like).

- The header is wrong. Here is a header which works:

    <?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN"
      "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
    <svg width="..." height="..."
    >
	<defs>

Note: For viewBox to work, you must have my patch installed. Until
my patch is integrated into FOP, I'd suggect that you don't use
viewBox. It should work without.

I know that the SVG will not work if standalone is not "no"
and when the svg element contains other attributes than width
and height. I don't know yet, which confuse FOP and why
no error is printed. I also don't have time to fix it.

Also note that FOP only supports a fraction of Batik (Batik
seems to support 95-99% of SVG while FOP supports about 10-20%).
So don't try things which are too complex (gradient fills,
text-on-path, etc), yet.

-- 
==============================================
Sowatec AG,       CH-8330 Pfäffikon (ZH)
Witzbergstr. 7,   http://www.sowatec.com
Tel: +41-(0)1-952 55 55
Fax: +41-(0)1-952 55 66
----------------------------------------------
Aaron "Optimizer" Digulla, digulla@sowatec.com
==============================================

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org