Replies: 12 comments 9 replies
-
The uber jar is larger because it includes all the dependencies. You'll also need those dependencies if you use Batik, so the situation is similar. EchoSVG, including the css4j engine and all its dependencies, is 4.52MB compressed. But you also need the A fat jar with Batik would be a bit smaller because the CSS engine is much simpler, but would be like 7.5MB anyway.
Which build tool are you using? If you only need some echosvg module and its dependencies (from your description it isn't clear which module you need), your build tool should be able to do that. From a quick Google search:
Tailoring the build of downstream applications is something that should be done at downstream level, not in EchoSVG's build. |
Beta Was this translation helpful? Give feedback.
-
@carlosame, I'm building using the sample gradle commands from the shell. The simple "./gradlew uberjar" command is what's resulting in an 8 MB jar when I do so. If I go to the Batik website and download their built release, the included "batik-all-1.17.jar" is 4 MB. I can slot that jar right in with one of my apps and be able to write out an SVG document to disk using the same Graphics2D calls that the app uses for rendering in the UI on-screen. |
Beta Was this translation helpful? Give feedback.
-
So you are using the So if you execute: ./gradlew echosvg-svggen-jar-with-deps you obtain |
Beta Was this translation helpful? Give feedback.
-
@carlosame, I found that just the echosvg-svggen-1.1-SNAPSHOT-with-deps.jar was not enough to write an SVG file to disk as a Also, for cases where my need to write SVG output with a bitmap embedded, then it was necessary to replace echosvg-svggen with echosvg-svgrasterizer---width-deps. Which is a hefty 7 MB. |
Beta Was this translation helpful? Give feedback.
-
Are you sure? AFAIK it can use any DOM implementation, not necessarily EchoSVG's. I mean you could use the default DOM provided by the JDK (haven't tested that though). BTW if you prefer to use a SVGOM or any other DOM, that's up to you to add it to the classpath. That's why I wrote that this should be handled by the build process of your (downstream) application and not by EchoSVG's.
As explained in my first reply, the dependencies of EchoSVG are essentially the same as Batik's (except for the CSS engine and its dependencies). In fact you save a couple of Batik dependencies that this project does not need. You may be fine without Rhino, I'm moving this to Discussions, as little more can be done by the EchoSVG build system. |
Beta Was this translation helpful? Give feedback.
-
TBH, I did not consider using a generic DOM object. I got started on this using an example from the Batik website that uses their class Sorry if it seems like I'm giving you grief. I'm just trying to figure out how to include the minimal necessary single additional JAR in my app distros. The Batik "all" jar was blowing up one of the apps about 25%. I'll take another look at this tomorrow and see if another DOM will work. |
Beta Was this translation helpful? Give feedback.
-
FWIW I just removed the If you are simply running |
Beta Was this translation helpful? Give feedback.
-
New wiki page about SVG Generator, with an example that uses the JDK built-in DOM. Yes it works. |
Beta Was this translation helpful? Give feedback.
-
That's very nice. Thank you. Generally works very well when the only Echo jar in my class path is The one problem I still confront is that for some use cases, my apps may need to call Curiously, if the Also, any time you want to cut this off, that's okay. I'm just trying to figure out how to add a requested feature to my apps with the least personal effort. No reason that someone else should have to put in that effort. |
Beta Was this translation helpful? Give feedback.
-
Version 1.1 is out and, as I heard no news, I assume that you didn't find any subsequent issues. Can we close this? |
Beta Was this translation helpful? Give feedback.
-
@carlosame , I got distracted by another couple things and haven't really looked at this in the past week or more. Will try to do so in the next couple days. |
Beta Was this translation helpful? Give feedback.
-
@carlosame, Go ahead and close this. With the 1.1.1 and 1.2 releases, I am able use just the However, I'm still a bit bothered by the jar size, which I know is a petty complaint this day and age. But I have other things that really demand my attention now, so I will let this lie aside until I have a few more users say that they would like SVG output. |
Beta Was this translation helpful? Give feedback.
-
The overall README describes some possibilities for different builds, with example gradle specifications. But not what I need, alas.
The problem I have is that the only option described that produces a jar that I immediately find useful is the "uber jar" or fat jar. And unfortunately it is 8 MB in size. By comparison the Batik "all" jar is about 4 MB.
My use case is that I would like a single jar that I can add to my product classpath, for a couple applications that users have said that they would like SVG output (in addition to the already provided PS or PDF). The Batik 4 MB jar seemed like bloat compared to my app sizes, but then I encountered Echo's uber jar.
So is there a way to produce a smaller Echo jar, rather than try to figure out which pieces and parts I need from the multiple-module build? It would be even better if as a Gradle build option I could specify "just give me the modules I need for writing an SVG file to disk, but in a single jar".
Beta Was this translation helpful? Give feedback.
All reactions