Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of date documentation? Trying to load inputstream and parse all elements #96

Open
i-make-robots opened this issue Mar 31, 2022 · 5 comments

Comments

@i-make-robots
Copy link

Hello!

I'm experimenting with svgSalamander as a replacement for Batik. I found this lib through a stack exchange post.
I'm using the 1.0 version available in maven central. The documentation provided is not matching what I'm seeing in the API.
I'd like to load an SVG from the provided InputStream, enumerate contents, and convert the elements to my custom path format.
How, please?

@blackears
Copy link
Owner

The latest release is 1.1.3 - you may want to grab that from the releases. The maven central repository has not been updated in some time because I've not been able to get the upload process to complete for years now. Some others have uploaded unofficial version, though.

What errors are you getting? Calling SVGUniverse.loadSVG() should load your document. What code are you using and what are the results you expect to see?

@i-make-robots
Copy link
Author

I've not been able to get the upload process to complete for years now.
goals! :)

What errors are you getting?
the how to get started docs don't match the last maven release, there are undocumented parameters that have to be supplied. Not knowing what to put I can't even reach the compile stage.

@blackears
Copy link
Owner

You need to compile using the maven build file. A language generator is run as part of the build process that generates some files.

You can also look at the examples project to get some demonstrations of how to use the library. I'm afraid your request is a bit too broad for me to answer, but if you have more specific questions about something I can try to answer that.

@NiliStein
Copy link

The latest release is 1.1.3 - you may want to grab that from the releases. The maven central repository has not been updated in some time because I've not been able to get the upload process to complete for years now. Some others have uploaded unofficial version, though.

What errors are you getting? Calling SVGUniverse.loadSVG() should load your document. What code are you using and what are the results you expect to see?

Hi, I'm joining this issue.
I have a local SVG file (test1.svg) which I would like to load.
So, here's what I've done:

        val svgUniverse = SVGUniverse()
        val inputStream = resources.openRawResource(R.raw.test1)
        val uri = svgUniverse.loadSVG(inputStream,"test1.svg") //this is not working

Alternatively, I also tried:

        val svgUniverse = SVGUniverse()
        // imagine here some code for creating a valid URI in the following line
        val uriFromPath = URI(someStrForThisUri)
        val diagram = svgUniverse.getDiagram(javaUri, true); //this fails

This one actually fails in SVGUniverse in the following line under the else statement, throwing an exception:

                        url = xmlBase.toURL();

Which is pretty much expected to fail there.

Is there an alternative for a local resource?
I would love to know about it if there is.

Thanks!

@blackears
Copy link
Owner

The string you should be passing to loadSvg(Inputstream, String) is a URI that the SVGUniverse will be using to reference your document, not the name of the file. I'm not sure why svgUniverse.getDiagram(javaUri, true); isn't working. What error message are you getting? Also, if you're still having problems, it would be best to file this as a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants