Skip to content

squeegee is a simple Dropwizard-based HTTP pony to convert SVG documents in to PNG files using the Batik SVG transcoder.

Notifications You must be signed in to change notification settings

whosonfirst/java-dropwizard-squeegee

Repository files navigation

java-dropwizard-squeegee

squeegee is a simple Dropwizard-based HTTP pony to convert SVG documents in to PNG files using the Batik SVG transcoder.

How to start the squeegee application

  1. Run mvn clean install to build your application
  2. Start application with java -jar target/squeegee-0.1.jar server config.yml
  3. To check that your application is running enter url http://localhost:8080

Usage

Given a file like this:

<?xml version="1.0"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
  <circle cx="200" cy="200" r="199" style="fill: red; stroke: blue; stroke-width: 0"/>
  <circle cx="200" cy="200" r="150" style="fill: blue; stroke: green; stroke-width: 5"/>
  <circle cx="200" cy="200" r="50" style="fill: yellow; stroke: orange; stroke-width: 7"/>    
</svg>

You would invoke squeegee like this:

curl -s -v -X POST -F svg=@circles.svg http://localhost:8080

Which would produce this:

circles

Docker

Yes. For example:

docker build -t squeegee .
docker run -it -p 6161:8080 squeegee
curl -s -v -X POST -F svg=@circles.svg http://localhost:6161 > circles.png

Caveats

  • This does not have a (Dropwizard) health check yet. It should.

Things that squeegee can't do yet

  • User-defined image dimensions - or more specifically, it doesn't resize images particularly well yet; you can pass a height and width parameter with your request and see for yourself but you should be aware this functionality might still be removed
  • User-defined (CSS) stylesheets
  • That other thing you're wondering about that I haven't thought of yet

See also

About

squeegee is a simple Dropwizard-based HTTP pony to convert SVG documents in to PNG files using the Batik SVG transcoder.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published