setFunctionLock(LockFunction.COMPILE, true);
showStatus("Compiling document...", false);
app.getPreviewer().clear();
app.getOutput().clear();
app.getFooter().getPageViewer().reset();
compile("png", new CompileCallback() {
@Override
public void onFailure(Throwable caught) {
setFunctionLock(LockFunction.COMPILE, false);
handleError(caught, cmd, null, 0);
}