You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Shan Kajendran <sh...@adsgroup.com> on 2003/09/12 12:26:19 UTC

SVG to PDF Conversion

Dear Friends,

I am in the process of converting SVG files into PDF using FOP.  With
the help of this forum i did manage to achieve the above task.  Actually
what i am doing is embedding SVG file into "fo" files which came with
FOP installation and using the command line "C:\>fop example.fo
example.pdf".

When i try to convert the simple SVG file (see below), FOP is converting
to PDF with no problem.

------------------------------------------------------------------------
--------------------

<svg contentScriptType="text/ecmascript" width="400"
xmlns:xlink="http://www.w3.org/1999/xlink" zoomAndPan="magnify"
contentStyleType="text/css" height="450" preserveAspectRatio="xMidYMid
meet" xmlns="http://www.w3.org/2000/svg" version="1.0">

<rect width="100" x="10" height="50" y="20" style="fill:red"/>

</svg>

------------------------------------------------------------------------
--------------------

But when i try some other SVG files which is containing some new
elements (glyph, g etc) the FOP is throwing error.  Please see the
attachment.

------------------------------------------------------------------------
--------------------

[ERROR] Unsupported element encountered: missing-glyph (Namespace:
default). Sou
rce context: file:/D:/fop-0.20.5/matcast.fo (line: 104, col: 22)
[ERROR] Unsupported element encountered: path (Namespace: default).
Source conte
xt: file:/D:/fop-0.20.5/matcast.fo (line: 105, col: 33)
[ERROR] Unsupported element encountered: glyph (Namespace: default).
Source cont
ext: file:/D:/fop-0.20.5/matcast.fo (line: 107, col: 46)
[ERROR] Unsupported element encountered: style (Namespace: default).
Source cont
ext: file:/D:/fop-0.20.5/matcast.fo (line: 147, col: 28)
[ERROR] Unsupported element encountered: g (Namespace: default). Source
context:
 file:/D:/fop-0.20.5/matcast.fo (line: 154, col: 62)
[ERROR] NAMESPACE_ERR: An attempt is made to create or change an object
in a way
 which is incorrect with regard to namespaces.

------------------------------------------------------------------------
--------------------

So i come to the conclusion,  if we create an SVG according to W3
specification the FOP or Batik want handle it (may be only for
conversion).  Am i correct?

Please some one share some thought in this issue.

Thanks

Shan

RE: SVG to PDF Conversion

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]
> embedded tags...
> I ran a test myself (copied the supplied FO into the embedded svg example
                                                        ^^^

should be SVG, of course...

Greetz,

Andreas Delmelle

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


RE: SVG to PDF Conversion

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Shan Kajendran [mailto:shan@adsgroup.com]
> --------------------
>
> But when i try some other SVG files which is containing some new
> elements (glyph, g etc) the FOP is throwing error.  Please see the
> attachment.
>
> ------------------------------------------------------------------------
> --------------------
>
> [ERROR] Unsupported element encountered: missing-glyph (Namespace:
> default). Sou
    ^^^^

This error is typically caused by 'embedding' svg as
fo:instream-foreign-object, without adding explicit 'svg:'-namespace to the
embedded tags...
I ran a test myself (copied the supplied FO into the embedded svg example
that comes with FOP) & afterwards, I only received errors for the following
svg-elements:

- feComponentTransfer
- feFuncA
- feSpecularLighting
- feDistantLight
- feComposite

Unable to say why exactly at the moment, but may help you on your way...


Greetz,

Andreas Delmelle


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