Problems with batik+svgSalamander (SVG/PDF Export)

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
hello Dimitry,

as you know batik produces broken output with svgSalamander rendered SVG icons.

Since so many users ask for it: Do you think we should file a bug report against one of these packages
(probably batik)?
What do you think?

Cheers and Best Regards,
Felix
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Dimitry Polivaev
Administrator
Hello Felix,

we could submit a bug report or a feature request indeed.
As I already have written,

>
> Problem comes from org.apache.batik.svggen.SVGPaint.toSVG(Paint)
>
>     public SVGPaintDescriptor toSVG(Paint paint){
>         // we first try the extension handler because we may
>         // want to override the way a Paint is managed!
>         SVGPaintDescriptor paintDesc = svgCustomPaint.toSVG(paint);
>
>         if (paintDesc == null) {
>             if (paint instanceof Color)
>                 paintDesc = SVGColor.toSVG((Color)paint, generatorContext);
>             else if (paint instanceof GradientPaint)
>                 paintDesc = svgLinearGradient.toSVG((GradientPaint)paint);
>             else if (paint instanceof TexturePaint)
>                 paintDesc = svgTexturePaint.toSVG((TexturePaint)paint);
>         }
>
>         return paintDesc;
>     }
>
> When SVGSalamander uses java.awt.RadialGradientPaint or java.awt.LinearGradientPaint (see com.kitfox.svg.RadialGradient and com.kitfox.svg.LinearGradient) they are ignored and color information is lost.

Best regards,
Dimitry




On 07.10.2017 10:03 wrote Felix Natter [via Freeplane Developer]:

> hello Dimitry,
>
> as you know batik produces broken output with svgSalamander rendered SVG icons.
>
> Since so many users ask for it: Do you think we should file a bug report against one of these packages
> (probably batik)?
> What do you think?
>
> Cheers and Best Regards,
> Felix
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion below:
> http://freeplane-developer.996965.n3.nabble.com/Problems-with-batik-svgSalamander-SVG-PDF-Export-tp1086.html
> To start a new topic under Freeplane Developer, email [hidden email]
> To unsubscribe from Freeplane Developer, click here <
> NAML <
http://freeplane-developer.996965.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
hi Dimitry,

I am in the process of creating a minimal, batik+svgSalamander example.

Cheers and Best Regards,
Felix
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
In reply to this post by Dimitry Polivaev
hi Dimitry,

ist is a (rather) minimal example:
https://github.com/fnatter/svgtest

I think I shall the report against batik?

Cheers and Best Regards,
Felix

Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
In reply to this post by Felix Natter
hello Freeplane developers,

I found a batik ExtensionHandler which adds support for java.awt.Linear/RadialGradientPaint:
https://issues.apache.org/jira/browse/BATIK-1032
which can easily be used by Freeplane:
ctx.setExtensionHandler(new GradientExtensionHandler());

Its transforms seem broken, but I think I fixed this:
https://github.com/fnatter/svgtest/commit/bb5b87a3f508175286e073fc1cc539784f438f4c#diff-02281c71c4caf5013845409bf7d1fc8bR120

This works for my three test graphics (SVG and PDF export), hopefully a batik dev will review this.

I will now re-activate the SVG/PDF export on a separate branch by undoing this change:
https://github.com/freeplane/freeplane/commit/06e49912bbc393baca6d212776d587d0d09792c6
Once that is done we can test whether it works for _all_ icons.

Cheers and Best Regards,
Felix
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Dimitry Polivaev
Administrator
Excellent!!!!

Dimitry

On 14.10.2017 11:39, Felix Natter [via Freeplane Developer] wrote:

> hello Freeplane developers,
>
> I found a batik ExtensionHandler which adds support for java.awt.Linear/RadialGradientPaint:
> https://issues.apache.org/jira/browse/BATIK-1032
> which can easily be used by Freeplane:
> ctx.setExtensionHandler(new GradientExtensionHandler());
>
> Its transforms seem broken, but I think I fixed this:
> https://github.com/fnatter/svgtest/commit/bb5b87a3f508175286e073fc1cc539784f438f4c#diff-02281c71c4caf5013845409bf7d1fc8bR120
>
> This works for my three test graphics (SVG and PDF export), hopefully a batik dev will review this.
>
> I will now re-activate the SVG/PDF export on a separate branch by undoing this change:
> https://github.com/freeplane/freeplane/commit/06e49912bbc393baca6d212776d587d0d09792c6
> Once that is done we can test whether it works for _all_ icons.
>
> Cheers and Best Regards,
> Felix
>
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
In reply to this post by Felix Natter
hello Freeplane devs,

I added this on branch "svgexport", and it works for all icons as far as I can see.
I have created a distribution (binary zip only), and requested testing in the forum.

@Dimitry or @Joe: Could you help me clean up the freeplane_plugin_svg dependencies
and use batik 1.9.1?

Cheers and Best Regards,
Felix
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Dimitry Polivaev
Administrator
>
> @Dimitry or @Joe: Could you help me clean up the freeplane_plugin_svg dependencies
> and use batik 1.9.1?

Is just

compile 'org.apache.xmlgraphics:batik-anim:1.9.1',
            'org.apache.xmlgraphics:batik-awt-util:1.9.1',
            'org.apache.xmlgraphics:batik-bridge:1.9.1',
            'org.apache.xmlgraphics:batik-codec:1.9.1',
            'org.apache.xmlgraphics:batik-css:1.9.1',
            'org.apache.xmlgraphics:batik-dom:1.9.1',
            'org.apache.xmlgraphics:batik-extension:1.9.1',
            'org.apache.xmlgraphics:batik-ext:1.9.1',
            'org.apache.xmlgraphics:batik-gui-util:1.9.1',
            'org.apache.xmlgraphics:batik-gvt:1.9.1',
            'org.apache.xmlgraphics:batik-parser:1.9.1',
            'org.apache.xmlgraphics:batik-script:1.9.1',
            'org.apache.xmlgraphics:batik-svg-dom:1.9.1',
            'org.apache.xmlgraphics:batik-svggen:1.9.1',
            'org.apache.xmlgraphics:batik-swing:1.9.1',
            'org.apache.xmlgraphics:batik-transcoder:1.9.1',
            'org.apache.xmlgraphics:batik-util:1.9.1',
            'org.apache.xmlgraphics:batik-xml:1.9.1',

sufficient?
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
LOL no, not at all!

We have batik, fop, xmlgraphics, Avalon, xerces.
It works with 1.7 but Debian has 1.9
and it's broken there and much easier
to test/fix upstream.

Cheers and Best Regards,
Felix

Am 14.10.2017 um 23:09 schrieb Dimitry Polivaev [via Freeplane Developer] <[hidden email]>:

>
> @Dimitry or @Joe: Could you help me clean up the freeplane_plugin_svg dependencies
> and use batik 1.9.1?

Is just

compile 'org.apache.xmlgraphics:batik-anim:1.9.1',
            'org.apache.xmlgraphics:batik-awt-util:1.9.1',
            'org.apache.xmlgraphics:batik-bridge:1.9.1',
            'org.apache.xmlgraphics:batik-codec:1.9.1',
            'org.apache.xmlgraphics:batik-css:1.9.1',
            'org.apache.xmlgraphics:batik-dom:1.9.1',
            'org.apache.xmlgraphics:batik-extension:1.9.1',
            'org.apache.xmlgraphics:batik-ext:1.9.1',
            'org.apache.xmlgraphics:batik-gui-util:1.9.1',
            'org.apache.xmlgraphics:batik-gvt:1.9.1',
            'org.apache.xmlgraphics:batik-parser:1.9.1',
            'org.apache.xmlgraphics:batik-script:1.9.1',
            'org.apache.xmlgraphics:batik-svg-dom:1.9.1',
            'org.apache.xmlgraphics:batik-svggen:1.9.1',
            'org.apache.xmlgraphics:batik-swing:1.9.1',
            'org.apache.xmlgraphics:batik-transcoder:1.9.1',
            'org.apache.xmlgraphics:batik-util:1.9.1',
            'org.apache.xmlgraphics:batik-xml:1.9.1',

sufficient?



If you reply to this email, your message will be added to the discussion below:
http://freeplane-developer.996965.n3.nabble.com/Problems-with-batik-svgSalamander-SVG-PDF-Export-tp1086p1093.html
To start a new topic under Freeplane Developer, email [hidden email]
To unsubscribe from Freeplane Developer, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Dimitry Polivaev
Administrator
Obviously I do not get what you mean. Could you explain?

By the way, unfortunately the new code signing certificate could not be installed yet (I tried it last Friday) and therefore I can not create new releases at the moment. Next week I shall contact the certum support.

Regards,
Dimitry

On 15.10.2017 08:04, Felix Natter [via Freeplane Developer] wrote:

> LOL no, not at all!
>
> We have batik, fop, xmlgraphics, Avalon, xerces.
> It works with 1.7 but Debian has 1.9
> and it's broken there and much easier
> to test/fix upstream.
>
> Cheers and Best Regards,
> Felix
>
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

joetopshot
In reply to this post by Felix Natter

I just installed Redhat 7.4 (enterprise edition).  I'll test there.


On 15-Oct-17 9:04 AM, Felix Natter [via Freeplane Developer] wrote:
LOL no, not at all!

We have batik, fop, xmlgraphics, Avalon, xerces.
It works with 1.7 but Debian has 1.9
and it's broken there and much easier
to test/fix upstream.

Cheers and Best Regards,
Felix

Am 14.10.2017 um 23:09 schrieb Dimitry Polivaev [via Freeplane Developer] <[hidden email]>:

>
> @Dimitry or @Joe: Could you help me clean up the freeplane_plugin_svg dependencies
> and use batik 1.9.1?

Is just

compile 'org.apache.xmlgraphics:batik-anim:1.9.1',
            'org.apache.xmlgraphics:batik-awt-util:1.9.1',
            'org.apache.xmlgraphics:batik-bridge:1.9.1',
            'org.apache.xmlgraphics:batik-codec:1.9.1',
            'org.apache.xmlgraphics:batik-css:1.9.1',
            'org.apache.xmlgraphics:batik-dom:1.9.1',
            'org.apache.xmlgraphics:batik-extension:1.9.1',
            'org.apache.xmlgraphics:batik-ext:1.9.1',
            'org.apache.xmlgraphics:batik-gui-util:1.9.1',
            'org.apache.xmlgraphics:batik-gvt:1.9.1',
            'org.apache.xmlgraphics:batik-parser:1.9.1',
            'org.apache.xmlgraphics:batik-script:1.9.1',
            'org.apache.xmlgraphics:batik-svg-dom:1.9.1',
            'org.apache.xmlgraphics:batik-svggen:1.9.1',
            'org.apache.xmlgraphics:batik-swing:1.9.1',
            'org.apache.xmlgraphics:batik-transcoder:1.9.1',
            'org.apache.xmlgraphics:batik-util:1.9.1',
            'org.apache.xmlgraphics:batik-xml:1.9.1',

sufficient?



If you reply to this email, your message will be added to the discussion below:
http://freeplane-developer.996965.n3.nabble.com/Problems-with-batik-svgSalamander-SVG-PDF-Export-tp1086p1093.html
To start a new topic under Freeplane Developer, email [hidden email]
To unsubscribe from Freeplane Developer, click here.
NAML



If you reply to this email, your message will be added to the discussion below:
http://freeplane-developer.996965.n3.nabble.com/Problems-with-batik-svgSalamander-SVG-PDF-Export-tp1086p1094.html
To start a new topic under Freeplane Developer, email [hidden email]
To unsubscribe from Freeplane Developer, click here.
NAML

-- 
Joe Berry
[hidden email]
--
Joe Berry
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
"joetopshot [via Freeplane Developer]"
<[hidden email]> writes:

hello Joe,

I think you misunderstood me, sorry.

> I just installed Redhat 7.4 (enterprise edition).  I'll test there.

All that is needed to be tested is SVG and PDF export (with many
different icons) :-) The OS shouldn't matter as we're using java-only
libraries. Please use the "svgexport" branch.

Thanks and Best Regards,
--
Felix Natter
debian/rules!
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
In reply to this post by Dimitry Polivaev
"Dimitry Polivaev [via Freeplane Developer]"
<[hidden email]> writes:

hi Dimitry,
hi Joe,

> Obviously I do not get what you mean. Could you explain?

Sorry for the confusion, I was not verbose because I was typing on my
mobile phone.

The freeplane_plugin_svg dependencies are a mess: We have batik, fop,
xmlgraphics, Avalon, xerces; some from maven, some committed; almost all
outdated.

The current artifacts for batik 1.7 etc. do work (see svgexport branch),
but are a nightmare for me because Debian uses more recent versions, and
it is _much_ easier to debug+fix issues with batik 1.9 in Freeplane
upstream than in the Debian package.

I will ask on the batik mailing list about the recommended maven
artifacts for batik 1.9 and fop 2.1. There must be a simple solution.

> By the way, unfortunately the new code signing certificate could not
> be installed yet (I tried it last Friday) and therefore I can not
> create new releases at the moment. Next week I shall contact the
> certum support.

I have no problem with this, that way I have enough time to fix the
freeplane_plugin_svg dependencies :-)

Cheers and Best Regards,
--
Felix Natter debian/rules!
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

joetopshot
Well, I have been playing with this new svgexport branch for a while now.  I have used existing mm files and created new ones with lots of icons.  Outputting to pdf and svg they all look like the original mm file.  Everything looks good.  No error messages in the console window.
--
Joe Berry
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
Hello Joe,

many thanks! I will work out using batik 1.9,
then this can be merged to 1.6.x.

Cheers and Best Regards,
Felix

Am 16.10.2017 um 15:33 schrieb joetopshot [via Freeplane Developer] <[hidden email]>:

Well, I have been playing with this new svgexport branch for a while now.  I have used existing mm files and created new ones with lots of icons.  Outputting to pdf and svg they all look like the original mm file.  Everything looks good.  No error messages in the console window.
--
Joe Berry



If you reply to this email, your message will be added to the discussion below:
http://freeplane-developer.996965.n3.nabble.com/Problems-with-batik-svgSalamander-SVG-PDF-Export-tp1086p1100.html
To start a new topic under Freeplane Developer, email [hidden email]
To unsubscribe from Freeplane Developer, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Problems with batik+svgSalamander (SVG/PDF Export)

Felix Natter
hello Joe, hello Dimitry,

I have changed the svg plugin to use batik-1.9 and cleaned up the dependencies:

        // libbatik-java / batik-*.jar:
        compile 'org.apache.xmlgraphics:batik-all:1.9.1'
       
        // libxml-commons-external-java 1.4.01:
        // org.w3c.dom.svg.SVGDocument
        //compile 'org.apache.xmlgraphics:xmlgraphics-commons:2.2': does not help!
        compile 'xml-apis:xml-apis:1.4.01'
        compile 'xml-apis:xml-apis-ext:1.3.04'
       
        // org.apache.xmlgraphics.java2d.color.NamedColorSpace
        // libxmlgraphics-commons-java / xmlgraphics-commons.jar:
        compile group: 'org.apache.xmlgraphics', name: 'xmlgraphics-commons', version: '2.2'

        // libfop-java / fop.jar:
        compile group: 'org.apache.xmlgraphics', name: 'fop', version: '2.1'

        // libavalon-framework-java / avalon-framework.jar:
        // PDF problem: org.apache.avalon.framework.configuration.Configurable
        compile group: 'org.apache.avalon.framework', name: 'avalon-framework-api', version: '4.3.1'
        // PDF problem: org.apache.avalon.framework.configuration.DefaultConfiguration
        compile group: 'org.apache.avalon.framework', name: 'avalon-framework-impl', version: '4.3.1'

        // libcommons-logging-java / commons-logging.jar:
        // PDF problem: org.apache.commons.logging.Log
        compile 'commons-logging:commons-logging:1.2'

Since this works well, I have merged "svgexport" to 1.6.x.

Cheers and Best Regards,
Felix