I draw figure in Flsh ID with JSFL methods, for example
// draw rectangle
doc.addNewLine({x:0, y:0}, {x:2000, y:0});
doc.addNewLine({x:2000, y:0}, {x:2000, y:500});
doc.addNewLine({x:2000, y:500}, {x:0, y:500});
doc.addNewLine({x:0, y:500}, {x:0, y:0});
// how can I fill it, because this way doesn't work
doc.setFillColor('#0000ff');