fixed postlink script
revised document format
canvas viewports are correctly removed when canvases are closed