Open davidsara opened 2 years ago
I'll look at it. It requires a change to Archi itself as well as jArchi so would have to tie in with the next Archi release.
Just FYI, for now I'm using this simple Python script to set minimum width of exported SVG files. Could be useful workaround.
from bs4 import BeautifulSoup
import os
import os.path
def setViewBox(fileName):
with open(fileName, 'r') as f:
data = f.read()
svg_xml = BeautifulSoup(data, 'xml')
svg = svg_xml.find('svg')
viewBox = svg.get('viewBox')
values = viewBox.split()
if (int(values[2]) < 1200):
svg['viewBox'] = values[0] + ' ' + values[1] + ' 1200 ' + values[3]
with open(fileName, 'w') as f:
f.write(str(svg_xml))
for dirpath, dirnames, filenames in os.walk("."):
for filename in [f for f in filenames if f.endswith(".svg")]:
setViewBox(os.path.join(dirpath, filename))
Hi! Current API allows to export to SVG using $.model.renderViewToSVG(view, filePath, setViewBox)
Would it be possible to add viewBoxBounds optional parameter to enter min_x, min_y, width and height as seen in GUI?
For example:
Thanks, David