If I put the height and width it will resize according to my measures, but if I have a raw file (SVG), it will not work. Is is possible to resize pure raw file (SVG) or only programming code can resize such objects?
well a PDF is not a ‘raw file’. Just to make that clear.
The SVG scales because it’s got a set viewBox.
Setting the height and width of an SVG element defines the screen coordinates that the SVG element occupies.
The viewbox then says “the upper left corner of my element is relative-coordinate x,y, the relative-width of my canvas is w, and the relative-height of my canvas is h.” It then takes the instructions given inside the SVG (that ‘path’ element), and draws the lines based upon the relative coordinates within that element.
Consider: If I tell my SVG element it is 200x200, and is on the screen at 10,10, and it’s viewbox is 0,0,100,100.
Then if i draw a line from 0,0 to 0,10 in my SVG path, what it ACTUALLY draws on screen is a line from 10,10 to 10,30 on the screen - but I don’t need to know anything about the screen to know how to draw my line. The browser takes care of the relative-to-absolute conversion for me.
If your ‘raw’ SVG file contains the same definitions, you will get the same scaling picture.
viewBox=“0 0 270 70”
The relative-width of my canvas is w: 270
The relative-height of my canvas is h: 70
Your quotation:
The viewbox then says “the upper left corner of my element is relative-coordinate x,y, the relative-width of my canvas is w, and the relative-height of my canvas is h.”
Can be logo resized to 270x70 px if I understand according to the relative coordinates within that element?
If your viewbox is 270x70, and your SVG is 270x70, there is no resizing going on; the relative coordinates translate directly to the absolute cordinates on a 1:1 scale.