-- an empty page, A4 in landscape pl = Graphics.New() print(string.format("pl: %.1f mm by %.1f mm, lower left corner at (%.0f mm, %.0f mm)", pl.SizeX, pl.SizeY, pl.OriginX, pl.OriginY)) -- an empty page of 100 mm by 60 mm pl2 = Graphics.New({{"Canvas.Size.X",100}, {"Canvas.Size.Y",60}}) print(string.format("pl2: %.1f mm by %.1f mm", pl2.SizeX, pl2.SizeY)) -- a page made from a table in the form of Graphics.ToTable: a filled triangle and a text below it pl3 = Graphics.New({CanvasSize = {100, 60}, Line = { {Point = { {0.1,0.2}, {0.9,0.2}, {0.5,0.9} }, CloseAndFill = true, FillColor = 0x80FF0000} }, Text = { {String = "a triangle", Point = {0.5,0.05}, Alignment = "c", Size = 0.1} }}) print(string.format("pl3: %.1f mm by %.1f mm, %d line and %d text", pl3.SizeX, pl3.SizeY, pl3.NLine, pl3.NText)) file = io.open("Triangle.svg", "w") file:write(Graphics.ToSVG(pl3, {{"RelativeSize",true}})) file:close()