G
G
Greg1oo2016-01-04 16:42:22
PostgreSQL
Greg1oo, 2016-01-04 16:42:22

How to generate SVG images using Java?

Let's say we have blank models that are stored in the database as three-dimensional objects. You need to make a program that will make 3D models, or svg images that are stored in the database. As I understand it, PostgreSQL can be used as a database to store large objects. But I don't know how to generate SVG images. The output is on the browser window.
I am writing in Java. Little experience in programming. Help advice. :)
All the best! And happy New Year!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-01-04
@petermzg

SVG is a scalable vector graphics markup language. You can generate it just like an html page.
For example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24">
   <path d="M9,5A3.5,3.5 0 0,1 12.5,8.5A3.5,3.5 0 0,1 9,12A3.5,3.5 0 0,1 5.5,8.5A3.5,3.5 0 0,1 9,5M9,13.75C12.87,13.75 16,15.32 16,17.25V19H2V17.25C2,15.32 5.13,13.75 9,13.75M17,12.66L14.25,9.66L15.41,8.5L17,10.09L20.59,6.5L21.75,7.91L17,12.66Z" />
</svg>

From there, you can start learning.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question