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
7
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
  • 315
  • 3
  • 10
7
votes
1 answer

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
  • 121
  • 1
  • 4
7
votes
2 answers

How to get the image size (width/height) of an SVG image with batik

How can I get the size (width/height) of an SVG image using batik (1.7)? String s = "https://openclipart.org/download/228858"; InputStream is = new URL(s).openStream(); DocumentBuilderFactory f =…
Thor
  • 6,607
  • 13
  • 62
  • 96
7
votes
1 answer

How to add SVG image to PDF built with HTML and Flying Saucer library (and Batik)?

Im working on generation of PDFs with XHTML using the flying saucer library (old but open source). I got that working but I also want to add SVG images. Ive started working on integrating batik to try and get it to work but I'm running into issues.…
Daxterwous
  • 299
  • 1
  • 3
  • 14
7
votes
1 answer

Unregister font with GraphicsEnvironment?

I recently found out how to register a TTF font with the local GraphicsEnvironment, s.t., for my use case (SVG-to-PNG transcoding), Apache Batik may recognize the font: import java.awt.Font; import java.awt.FontFormatException; import…
RobertG
  • 1,550
  • 1
  • 23
  • 42
7
votes
1 answer

How can I programatically convert SVG files containing text to PDF files (specifically on CentOS 5.3 x86_64)?

I would like to programatically convert SVG files to PDF files. However, the SVG files contain text that must be searchable in the generated PDF files. Also, it has to work on Red Hat Enterprise Linux 5.3 or CentOS 5.3 for the x86_64 architecture.…
Christopher Bottoms
  • 11,218
  • 8
  • 50
  • 99
7
votes
1 answer

Batik SVGGraphics2D nullpointerexception when drawing image

I'm trying to use the Batik library to draw a BufferedImage to a SVG file. I have very similar code working fine for EPS/PS files, but for some reason the following code: // Get a DOMImplementation and create an XML document DOMImplementation…
Alex Z
  • 1,449
  • 4
  • 20
  • 29
7
votes
3 answers

Poor Image Quality when using SVGConverter in Batik to convert svg to png

My converted image's quality is very low. I have tried using the setQuality method but it does not seem to change anything. This is the part of the code that converts svg to png: SVGConverter svgConverter = new SVGConverter(); String[] sources = {…
KrispyDonuts
  • 1,262
  • 2
  • 18
  • 37
6
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
  • 137
  • 1
  • 1
  • 10
6
votes
2 answers

How to merge multiple rectangles into one polygon

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 attached image, but I need the…
robbie70
  • 1,515
  • 4
  • 21
  • 30
6
votes
1 answer

Display svg on canvas

I want to display some images on a canvas accordingly to screen dimension without losing the image resolution. If I use a simple png or jpeg, I will see the image pixelized on a big screen. What I am thinking is to use svg files and display them on…
6
votes
1 answer

Getting specific elements with XPath from an SVG with Batik

I am trying to find some elements from an SVG document with Batik. This is the example SVG document I am using:
radlan
  • 2,393
  • 4
  • 33
  • 53
6
votes
1 answer

SVG to PNG text not showing properly - Arial font

I'm having an issue of converted PNG using Apache Batik is different when there is a text with different font-family, like Arial. The issue occurs in the environment where Cent OS 6 running Tomcat 7 and Java 6. The Java code used to convert SVG to…
Shantha Kumara
  • 3,272
  • 4
  • 40
  • 52
6
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
  • 18,670
  • 17
  • 71
  • 81
5
votes
1 answer

How to paint SVG images efficiently in Java?

Reference: How can you produce sharp paint results when rotating a BufferedImage? In the referenced question I asked about quality regarding transformations of rasterized images. Someone suggested that I should use SVG images, as the quality of…
rtheunissen
  • 7,347
  • 5
  • 34
  • 65
1
2
3
26 27