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
0
votes
1 answer

How to scale a word cloud?

I'm working on word cloud generation. My words should appear in a rectangle of (0, 0, w, h), where w is the max width and h is the max height. I already have an algorithm for generating the word cloud, but sometimes the words go outside the bounds…
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
0
votes
1 answer

Create SVG file from many small svg files in java

I'm currently working with JavaFX 2.2 und Batik. I have an application with a pane on which you can drag multiple SVG pictures. This is all working out, and the svg code of each picture is stored in each object, so I can get that, too. However now I…
user1582432
  • 725
  • 2
  • 7
  • 9
0
votes
1 answer

JSVGCanvas.getSVGDocument() is returning null?

I seem to have a problem working with batikSVG for manupilating SVG using Java. I can display the SVG just fine on the JSVG Canvas but when I try to the canvas's SVGDocument using getSVGDocument it seems to return null. Why is that, and how can I…
Bashir Beikzadeh
  • 761
  • 8
  • 15
0
votes
2 answers

SVG generation fails from command line, but is successful with NetBeans

I have a strange issue. I'm currently trying myself out with svg generation and I use the following code to generate an svg file: public class SVGGenerator { private static void drawSquare(Graphics2D g2d) { g2d.setPaint(Color.blue); …
Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175
0
votes
2 answers

Using Custom Element Factory When Reading SVG File Using Batik

I am trying to read a largish (1 MB) svg file that is exported from an old program. I do not have access to this program or the data. I only have this exported svg file and I will probably have to import a freshly exported svg file somewhat…
crowmagnumb
  • 6,621
  • 9
  • 33
  • 42
0
votes
1 answer

SVG to image quality reducing

My requirement is to convert .SVG to image. The SVG files are generated by internal tool. I am trying these by 2 approaches: Converting SVG to image using JPEG transcoder. My SVG files are complex maps, that has some text on it. The resulting…
varunrao321
  • 925
  • 2
  • 10
  • 18
0
votes
2 answers

Apache Batik - Exception: "content not allowed in prolog" converting PDF to JPEG

I am getting the an exception when I try to convert some PDF to JPEG, with the message "content not allowed in prolog". I am performing a two-step opertaion converting SVG to PDF and then PDF to image. I am facing this issue when I try to do the…
varunrao321
  • 925
  • 2
  • 10
  • 18
0
votes
0 answers

Trouble passing SVG variable through Coldfusion to Batik transcoder

There's something which I do not understand going on between getting the SVG code from the SQL table and passing it into Batik to transcode it (displaying the PNG). If I run the CF code below I get an error: The image cannot be displayed because it…
MikeW
  • 369
  • 1
  • 3
  • 8
0
votes
1 answer

Can't find the source of an exception in Java

Basically an exception is being thrown and I can't find the reason. Here is what I get on the console: Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 0 at…
Invader Zim
  • 796
  • 2
  • 14
  • 39
0
votes
1 answer

Seeing pixels of a SVG file when scaling in Java

I am handling a SVG file in Java using Batik library. The problem occurs when i scale it. I can see pixels of lines. Off course this should not happen, i should be able to zoom at least about 4000% and maintain the smoothness. SVG file is read from…
Invader Zim
  • 796
  • 2
  • 14
  • 39
0
votes
1 answer

Batik 1.7 gives Headless mode exception : NoClassDefFoundError: gnu/java/awt/peer/headless/HeadlessToolkit

I am implementing Batik-1.7 with transcoder.so it is giving error that: error: java.lang.NoClassDefFoundError: gnu/java/awt/peer/headless/HeadlessToolkit can anyone please suggest me how to use trancoder in headless mode... thanks,
Asha Koshti
  • 2,763
  • 4
  • 22
  • 30
0
votes
1 answer

Placing an object at a specific percentage along an svg path?

Currently I'm using the element to very quickly animate an object (defined by a path) to the correct end location. This is displaying ok in Chrome and I'm not working on getting it working with Batik. But I'm curious: is there a…
Robert
  • 247
  • 4
  • 12
-1
votes
1 answer

Java AlphaComposite Graphics2D objects without creating intermediate BufferedImages (for SVG export)

2 Graphics2D objects are being created with alphaComposite "embedded" in their creation process (so an additional setComposite in front seems useless) there is ability to export as SVGs in Batik SVGGenerator and JFreeSVG libraries and the vector…
jazznbass
  • 24
  • 6
-1
votes
1 answer

SVG image within a Batik JSVGCanvas is scaled down after rotation and setting bounding box

I have a problem with the rotation within a JSVGCanvas. The user can load SVG images into a document page (JLayeredPane). Every image displays in his own JSVGCanvas and has his own class. The user can resize the image by dragging the endpoints and…
SKH
  • 1
  • 4
-2
votes
2 answers

Reading SVG path in Java

I'm reading text files in java where I use the scanner class to read text in SVG format. I have seen answers that recommend Batik. I would like to know how to use Batik only on the path data in SVG format. I want to evaluate the path and extract…
the_ritz
  • 322
  • 2
  • 17
1 2 3
26
27