SVG + PDF Export

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SVG + PDF Export

Felix Natter
Administrator
hello Devs,

we have a problem: When using SVG icons, the PDF export seems broken.
It looks like svgsalamander is not easily married with batik.
Any idea how to fix this?

Thanks and Best Regards,
Felix
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SVG + PDF Export

Dimitry Polivaev
Administrator
Hello Felix,

I dived into the code.

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.

I think that removing batik based SVG and PDF exports is not a big loss because in my experience pdf printers do better job creating smaller pdf.

Regards,
Dimitry

> hello Devs,
>
> we have a problem: When using SVG icons, the PDF export seems broken.
> It looks like svgsalamander is not easily married with batik.
> Any idea how to fix this?
>
> Thanks 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/SVG-PDF-Export-tp1005.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>

Loading...