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
3
votes
2 answers

Convert a SVG image to a JPEG image using Apache Batik

I'm trying to convert a SVG image into JPEG as shown in https://xmlgraphics.apache.org/batik/using/transcoder.html#createImage example. Here is the code: public void saveAsjpeg() throws Exception { // Create a JPEG transcoder …
User1230321
  • 1,435
  • 4
  • 23
  • 39
3
votes
0 answers

Generating PDF with iText and batik

I'm trying to export text and SVG graphs to a PDF. I found out that iText and batik can do this. So I tried doing that, but everytime I put in a graph, it would become extraordinary small. I thought it might be something with my code, so I figured…
Benjamin Larsen
  • 345
  • 2
  • 15
3
votes
1 answer

SVG rendering in Java using SWT - Batik too slow

I am having performance issues with Batik when I try to render SVG files using SWT. It seems like a very bloated library but the only other one I could find was SVGSalamander and it looks like it's Swing only. Is there a way to render the SVGs…
V_H
  • 1,793
  • 3
  • 34
  • 59
3
votes
1 answer

Event clic with DOM / batik : Recovery the use tag which refers a symbol

Good evening, I am currently working on a graphics application (handling a svg file) in Java with the use of batik to directly manipulate DOM document svg. My various elements are declared in "symbol" tags are used and / displayed by the tags' "use…
MelodyBibi
  • 67
  • 10
3
votes
0 answers

Apache Batik Conversion SVG To PDF Not Formatting Text Style

Am trying to convert my svg file to pdf. Following is the svg code : The text formatting is working perfect on Firefox and just fine on chrome browser. But the text format code : style="text-anchor :middle; dominant-baseline: middle;…
gursahib.singh.sahni
  • 1,559
  • 3
  • 26
  • 51
3
votes
1 answer

Get bounding box of svg element?

I want to know the bounding box of an svg element. Taken from the project's examples: DOMImplementation impl = SVGDOMImplementation.getDOMImplementation(); String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI; Document doc =…
user3203425
  • 2,919
  • 4
  • 29
  • 48
3
votes
0 answers

Batik + debug information

I am trying to debug batik functionality via eclipse. And I'm getting next error: Unable to install breakpoint ... batik_class_name_here due to missing line number attributes. Looks like main batik distribution…
zapletnev
  • 493
  • 1
  • 5
  • 15
3
votes
2 answers

How to convert SVG to png or jpg

I've tried by using batik. But I'm getting empty png file. I've also included all the required jars. My code is import org.apache.batik.transcoder.image.PNGTranscoder; import org.apache.batik.transcoder.TranscoderInput; import…
nmkyuppie
  • 1,456
  • 1
  • 14
  • 30
3
votes
1 answer

Batik - Modify and saving of SVG results in not well formed XML

I'm trying to edit an existing SVG and save it afterwards using Batik (I need different formats and DOM-Manipulation). What I do: Adobe Illustrator Source File (CS 4.0) saved as SVG 1.0 with all Glyphs (two embedded Fonts) Loaded with Batik (using…
Raphael
  • 91
  • 1
  • 7
3
votes
1 answer

Disable logging with Batik Transcoder?

I'm using the batik transcoder for svgs, and every time I convert an SVG image, it produces output on standard out. I'm assuming it's using a logging package of some kind. How do I disable this output?
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
3
votes
1 answer

Eclipse Luna 4.4: application product with GMF, e4, BIRT, batik plugins does not validate

I am developing a Eclipse application and want to migrate to Eclipse 4.4 now. In my application setup I am using BIRT (latest release 4.4.0), which comes with the Apache Batik…
Terry
  • 14,529
  • 13
  • 63
  • 88
3
votes
0 answers

SVG length of text throws NullPointerException

I use Batik to create a SVG Document. I create a text element and want to get it's width. However I get a NPE: Element composite = container.getOwnerDocument().createElementNS(SVGUtility.SVG_NS, SVGConstants.SVG_G_TAG); SVGOMTextElement txt =…
matthias
  • 1,938
  • 23
  • 51
3
votes
0 answers

Why does the SVG image not become resized using Apache Batik and the Mac Renderer?

Currently I am working with an application that scales and displays SVG background images using a custom viewer JComponent which extends JSVGCanvas. Once the View class is added to a JViewPort, it should load the SVG image, resize it to fit the…
Kent Shikama
  • 3,910
  • 3
  • 22
  • 55
3
votes
2 answers

Parse SVG path style using Batik

Using Batik, I am converting some SVG code to direct Java/Scala code using Java2D commands. For example, I have the following fragment:
0__
  • 66,707
  • 21
  • 171
  • 266
3
votes
1 answer

Why dominant-baseline doesn't work when I convert svg to pdf?

Why dominant-baseline doesn't work when I convert svg to pdf using Java-based toolkit Batik. When I display svg in browser all ok and it works.
adelak
  • 647
  • 4
  • 11
  • 25