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
56
votes
6 answers

convert pdf to svg

I want to convert PDF to SVG please suggest some libraries/executable that will be able to do this efficiently. I have written my own java program using the apache PDFBox and Batik libraries - PDDocument document = PDDocument.load( pdfFile…
user434541
  • 1,245
  • 2
  • 13
  • 21
31
votes
3 answers

SVG Image in JavaFX 2.2

I am new to JavaFX 2.2 and as of now I couldn't find a way to display SVG Images in my JavaFX 2.2 application. I took a look at Batik, but it didn't do the trick for me as it converts to BufferedImages and not to javafx.ImageView. Is there any way…
user1582432
  • 645
  • 2
  • 7
  • 9
23
votes
4 answers

How to get a BufferedImage from a SVG?

I am using Batik to handle SVG images. Is there any way to get a java.awt.image.BufferedImage from a SVG-file? I know there are transcoders, with which I could transcode the SVG into, for example, a PNG and then load that PNG with ImageIO.read()·…
mr_georg
  • 3,425
  • 5
  • 32
  • 49
21
votes
2 answers

Smallest Java SVG Engine

What is the smallest Java SVG engine (least/smallest jars) that actually works? If your answer is Batik, what is the minimal dep. graph for getting this to work in a simple Java application? I've looked at the dependency graph on the Batik site,…
jsight
  • 26,474
  • 23
  • 103
  • 138
21
votes
5 answers

Swing & Batik: Create an ImageIcon from an SVG file?

Simply put, I'm looking for a way to make an ImageIcon from an SVG file using the batik library. I don't want to have to raster the SVG to disk first, I just want to be able to pull an svg out of the jar file and have it land as a UI element. I…
Electrons_Ahoy
  • 30,983
  • 34
  • 101
  • 126
17
votes
1 answer

How to do the group transforms in SVG file programmatically?

I have SVG file with following image: Each of the arrows is represented by a code like this: South, 180
Mentiflectax
  • 13,367
  • 41
  • 152
  • 285
16
votes
1 answer

How to load and parse SVG documents

Background There are number of unanswered questions related to reading and parsing SVG paths: Easiest way to read in svg path data with Java? Re: parsing a svg file using batik svg parser How to convert SVG Path (SVGOMPathElement) to array of…
Dave Jarvis
  • 28,853
  • 37
  • 164
  • 291
14
votes
1 answer

How to convert SVG into PNG on-the-fly

I try to convert an svg into PNG. the svg document is coming from a server as an Inputstream. First, I convert the svg stream into byte array with: byte[] streamBytes = IOUtils.toByteArray(svgStream); Then I convert the bytes into…
Kayser
  • 6,116
  • 17
  • 49
  • 86
14
votes
1 answer

Apache Batik No WriteAdapter is available?

I'm writing code to convert SVG's to PNG's: package com.example; import java.io.*; import java.nio.file.Paths; import org.apache.batik.transcoder.image.PNGTranscoder; import org.apache.batik.transcoder.SVGAbstractTranscoder; import…
Al Pacifico
  • 592
  • 3
  • 14
13
votes
1 answer

Scaling an SVG in Java

I'm attempting to scale an image, modify it, and then output to another image format. So far, I've been using the apache batik library. For simple conversion, this is easy. For clipping the svg, this is easy. However, I can't seem to figure out how…
Stefan Kendall
  • 61,898
  • 63
  • 233
  • 391
12
votes
4 answers

Where has org.apache.batik.dom.svg.SVGDOMImplementation gone?

In the documentation for batik, it shows how to get an instance of the DOM implementation from the class org.apache.batik.dom.svg.SVGDOMImplementation. However, after downloading Batik 1.8 from the same site, I cannot find this class anywhere. I…
harmic
  • 22,855
  • 3
  • 52
  • 72
10
votes
2 answers

How I use a custom font with the Batik SVG library?

I'm working on a Java program which creates templates for clothes. The user enters the word they want to see on the item of clothing and the system creates a PDF template. To create the template I create an SVG document programatically then use…
James Andrews
  • 3,120
  • 3
  • 28
  • 42
9
votes
1 answer

How do I superimpose one SVG image onto another using Apache Batik?

I have 2 SVG files I need to overlay using Batik. One file serve as the background image and is 308px by 308px while the second file (260px by 260px) is the foreground image that must be centered (that is at the center of the background image). I'd…
Olivier K
  • 91
  • 1
  • 3
8
votes
2 answers

Batik SVG to PDF - PDFTranscoder - Page Size A4

I was succesful converting an SVG File into PDF using Apache Batik. The following code is used to generate PDF: import org.apache.fop.svg.PDFTranscoder; import org.apache.batik.transcoder.TranscoderInput; import…
Walter
  • 225
  • 4
  • 13
8
votes
1 answer

Requested: https://www.w3.org/2000/svg Found: http://www.w3.org/2000/svg

We are using Apache Batik to render SVG files. For security reasons, all the URLs are converted to HTTP. Now, when we are rendering the SVG files, we get this issue. Original SVG is: svg xmlns=\"http://www.w3.org/2000/svg\"…
Ravipati Praveen
  • 366
  • 5
  • 24
1
2 3
24 25