Add flag to say if the canvas must be added to the document