P
P
Pavel K2016-02-01 18:22:02
SVG
Pavel K, 2016-02-01 18:22:02

How to understand from svg data what units of measurement are used?

Greetings!
It is necessary to work closely with the svg file, it remains only to understand the units of measurement, the scale. As a result, I need to convert all units of measurement to millimeters.
Here is an example of a title:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
   viewBox="0 0 3401.6 2551.2" enable-background="new 0 0 3401.6 2551.2" xml:space="preserve">

I empirically found out that all the coordinates here are in PT and for translation it is enough just to divide by 2.83465
The second heading:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
   viewBox="0 0 595 842" enable-background="new 0 0 595 842" xml:space="preserve">

and here 2.83465 is no longer suitable, but a completely different one is needed.
Anything that changes between these files:
viewBox="0 0 595 842"

I read the SVG spec, but I didn’t understand point-blank what the view box and units of measurement have to do with it.
Tell me, please, what is the dependence?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel K, 2016-02-01
@PavelK

As I understood from the specification, there is no dependency.
what would be, the height and width of the svg element with units of measurement must be set, otherwise it is considered that it is a percentage,
this is how I understood the specification.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question