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:

367 questions
5
votes
1 answer

Easiest way to read in svg path data with Java?

I'm looking to consume an svg image and parse/process the different paths to do a custom conversion. What is the easiest way, in Java, to simply extract the path data? I was looking at the apache xmlgraphics/batik packages, but it's not real…
end-user
  • 2,563
  • 4
  • 25
  • 49
5
votes
4 answers

Learning resources and tutorials for using the Java Batik Library

I am using the Batik library, which is very useful to display SVG graphics in Java. For the basic use case of displaying and rendering an SVG document is quite simple to use. However, I want to do some other advanced graphic manipulation and I am…
Mario Ortegón
  • 17,860
  • 17
  • 67
  • 79
5
votes
2 answers

Wrong values of bounding box for text element using Batik

I'm trying to draw a rectangle around a text element using getBBox(), the code is pretty straightforward, create document, add text element, boot document and add rectangle. The problem is that getBBox is returning some weird values, am I missing…
Hugo Giusti
  • 208
  • 2
  • 7
4
votes
2 answers

Can I use only the Transcoder of the Batik library without all other Batik code and dependencies?

I am trying to use the Batik library source, I only want to use the transcoder to convert SVG files to PNG or JPEG only. The distribution version of the Batik Rasterizer is about 55k but when I export the jar file its 7 megs. Can I just use the…
Jesse
  • 655
  • 2
  • 9
  • 28
4
votes
3 answers

Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper

How to solve "Assistive Technology not found" error in Google App Engine openJdk? I am developing one web app that uses Apache Batik, it works fine in local with jetty and oracle jdk, but when I deploy it to Google-App-Engine and I call my API I get…
GeetT
  • 243
  • 3
  • 9
4
votes
0 answers

Configure Batik to utilize custom fonts

I have an issue configuring Batik PDFTranscoder for Svg to Pdf conversion. I want to embed custom truetype fonts to PDF output, therefore I utilize Batik transcoder. I supply font configuration in fop config file, as described here:…
odoko
  • 91
  • 4
4
votes
5 answers

Apache Batik Transcoder inside Docker Container Blocking

We're running a Spring application within a docker container. Our application can take SVG files and transform them into PDF format to be embedded within a PDF. The application works correctly on osx and transcodes as expected. However when run from…
Liam
  • 113
  • 7
4
votes
1 answer

FOP batik NoClassDefFoundError: org/apache/batik/bridge/UserAgent

I do not use maven, or pom or anything. I just have simple test class for testing and I just try to make XSL-FO to PDF conversion and I get this error. The code is simple: package testing; import java.io.BufferedOutputStream; import…
zelenooq
  • 107
  • 1
  • 9
4
votes
1 answer

java how to merge multiple rectangles into one polygon

I hope someone can help as I am struggling with this part of my task at work.I've deliberately not detailed the context of the work task to try and keep the focus on the problem. I have to merge rectangles into a single polygon as shown in the…
robbie70
  • 1,145
  • 3
  • 12
  • 25
4
votes
1 answer

Batik SVG to PDF conversion

I am trying to use Batik to convert am SVG to JPG. In the SVG I am using an external google font, and for this reason this unfortunately this fails with following error: org.w3c.dom.DOMException:…
nutrina
  • 962
  • 1
  • 10
  • 25
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
  • 21,374
  • 12
  • 83
  • 129
4
votes
2 answers

How to resize an svg (with batik) and display it?

I have a svg file of 100x100 pixels (for example). I am using Batik. If I do a : JSVGCanvas svg = new JSVGCanvas(); [...] svg.setSize(10,10); It will only show this part of the picture and not the resized image. Do you know how I can display a…
g123k
  • 3,476
  • 6
  • 38
  • 44
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
  • 685
  • 6
  • 27
4
votes
5 answers

how to find package org.w3c.dom.svg?

I cannot seem to find it and Netbeans says that the package does not exist? Which jar do I have to get to have package org.w3c.dom.svg? I'm using batik SVG
Bashir Beikzadeh
  • 691
  • 8
  • 15
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
  • 1,826
  • 3
  • 24
  • 43
1 2
3
24 25