Questions tagged [batik]

Batik is a Java-based toolkit for applications or applets that want to use images in the Scalable Vector Graphics (SVG) format for various purposes, such as display, generation or manipulation.

Apache Batik is a Java-based toolkit for applications or applets that want to use images in the Scalable Vector Graphics (SVG) format for various purposes, such as display, generation or manipulation.

The project’s ambition is to give developers a set of core modules that can be used together or individually to support specific SVG solutions. Examples of modules are the SVG Parser, the SVG Generator and the SVG DOM. Another ambition for the Batik project is to make it highly extensible —for example, Batik allows the developer to handle custom SVG elements. Even though the goal of the project is to provide a set of core modules, one of the deliverables is a full fledged SVG browser implementation which validates the various modules and their inter-operability.

The Batik toolkit includes the following:

Modules:

  • An SVG DOM implementation
  • A set of SVG microsyntax parsers
  • A scripting module
  • A generator that creates an SVG document from Java2D calls
  • A Swing SVG component
  • A transcoder module

Tools and applications:

  • Squiggle, an SVG browser
  • An SVG rasterizer
  • A to SVG converter
  • A pretty printer for SVG source files

Official Website: http://xmlgraphics.apache.org/batik/

Useful Links:

391 questions
4
votes
1 answer

Can I create a JSVGCanvas without an svg file?

Looking through the documentation for JSVGCanvas, it seems like I might not be able to do this. However, it makes a lot of sense for this to be possible. How can I create a JSVGCanvas from a String variable instead of a File? My idea is that I could…
Justin
  • 24,288
  • 12
  • 92
  • 142
4
votes
1 answer

Required batik jars for loading SVG images

I use the batik-transcoder to read SVG files and transform them to BufferedImage. My problem is, that maven downloads about 19 another jars to compile my code. Which jars are required for my use case? The list of jars which are downloaded by maven…
Sergiy Medvynskyy
  • 11,160
  • 1
  • 32
  • 48
4
votes
2 answers

Is it possible to style svg with an external style sheet using batik in grails?

I have svg being passed from a gsp to my grails controller. I'm rendering it as a pdf and saving the file. However there is no styling attached. This makes sense as the styling is done using an external stylesheet. My question is is it possible to…
Travis
  • 705
  • 6
  • 30
4
votes
1 answer

Batik with grails giving sax clash

I'm trying to use batik with grails to render some SVG stuff to PNG on the server. I'm getting the following error in IntelliJ when I add the dependencies to BuildConfig and then tell IntelliJ to load the…
Greg Pagendam-Turner
  • 2,356
  • 5
  • 32
  • 49
4
votes
1 answer

Batik - calculating bounds of cubic spline

I'm using Batik to work with SVG images. Specifically I have a scene with a number of shapes and I need to be able to convert each shape to a separate BufferedImage. To do this I use the following code: SVGDocument document = null; // Load the…
James Andrews
  • 3,257
  • 3
  • 31
  • 45
3
votes
2 answers

SVG generation with FOP doesn't work

On one server, and on my Windows laptop, producing PDFs with this method works fine: http://www.databasesandlife.com/svg-to-pdf/ But on the other server I get this error: org.apache.batik.transcoder.TranscoderException: Error while setting up…
Adrian Smith
  • 17,236
  • 11
  • 71
  • 93
3
votes
2 answers

Having problems with Apache Batik library on AWS ElasticBeanstalk Instance

I am using AWS Elasti Beanstalk to power one of my apps. In this I need to export a svg document to png,jpg, pdf etc. For this I use Apache Batik library. This provides excellent output on my local dev workstation but as soon as I deploy it on the…
Chantz
  • 5,883
  • 10
  • 56
  • 79
3
votes
1 answer

How to Make Transparent SVG Transparent in Java?

I have SVG file that actually empty, that have no element, yet. I will manipulate it in the java code by adding element. The SVG file will be inserted in a scrollpane. The problem is even the SVG file actually empty, the Scrollpane not transparent…
dieend
  • 2,231
  • 1
  • 24
  • 29
3
votes
3 answers

"SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found" when using Batik in a webapp on Tomcat

This is possibly related to a classpath problem, but I'm really not sure at this point, since I don't get this error on some machines. The error at the top of the stack is SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found. Why…
Matt
  • 3,254
  • 3
  • 23
  • 32
3
votes
0 answers

Apache FOP XSLT with svg-text render quality chaged after batik library upgrade

We recently migrated from FOP 2.1 to FOP 2.6 and witnessed a change in PNG output quality. In our application fop is used with antialiasing OFF and in fop2.1 ( +batik 1.8) the text output is rendered nicely with no antialiasing . But after we…
Gurubg
  • 73
  • 7
3
votes
2 answers

Circumvent old java meta-inf / services when using Java modules

I am trying to make a Java FX application showing an SVG-image using the Batik-library, but I'm having issues getting all the components properly imported. After about 5 hours of searching and testing I have finally altered one of the dependencies'…
3
votes
2 answers

Using Eclipse RCP and Apache Batik together

Is it possible to use all the Batik components in an application developed in Eclipse RCP? Can you please point me to relevant documentation.
Sameer Patil
  • 526
  • 4
  • 13
3
votes
0 answers

Setting attributes for elements created with SVGGraphics2D

How can I set an attribute (such as "id") on SVG elements created with SVGGraphics2D? For example: I am creating a Polygon with the following code: i've already tried the following but it does not work: public static final String SVG_NS =…
SBKDeveloper
  • 613
  • 1
  • 9
  • 20
3
votes
1 answer

Batik load SVG file in SVGGraphics2D

I use batik for drawing svg, and save it. That work. But now i try to load my svg file and add somthing. I use this fonction for load my svg file private static SVGDocument loadSVGDocument(String uri) { String parser =…
zulot
  • 31
  • 3
3
votes
1 answer

Batik event listener

I am trying to add an event listener to a DOM element Element image = svgDocument.createElementNS(Constants.SVG_NS, SVG_IMAGE_TAG); image.setAttributeNS(Constants.SVG_NAMESPACE_XLINK_URI, SVGConstants.XLINK_HREF_QNAME, "file:///" + …
IrApp
  • 1,823
  • 5
  • 24
  • 42