function printDocument() {
    if (annotation.length == 0) {
        printPreview();
    } else {
        createExportDialogCheckboxes();
        var printDialog = $('#printDialog');
        printDialog.dialog({
            buttons: {
                'Print': function () {
                    printPreview();
                    $(this).dialog('close');
                }
            },
            title: 'Print'
        });
        printDialog.dialog('open');
    }
}
/**
 * Call createExportDialogCheckboxes, set button to #printDialog and open it. If array annotations is empty, function
 * only call printPreview().
 */
Call createExportDialogCheckboxes, set button to #printDialog and open it. If array annotations is empty, function
only call printPreview().
Call createExportDialogCheckboxes set button to #printDialog and open it . If array annotations is empty function only call printPreview () .
function printDocument() {
    if (annotation.length == 0) {
        printPreview();
    } else {
        createExportDialogCheckboxes();
        var printDialog = $('#printDialog');
        printDialog.dialog({
            buttons: {
                'Print': function () {
                    printPreview();
                    $(this).dialog('close');
                }
            },
            title: 'Print'
        });
        printDialog.dialog('open');
    }
}
function printDocument ( ) { if ( annotation . length == 0 ) { printPreview ( ) ; } else { createExportDialogCheckboxes ( ) ; var printDialog = $ ( '#printDialog' ) ; printDialog . dialog ( { buttons : { 'Print' : function ( ) { printPreview ( ) ; $ ( this ) . dialog ( 'close' ) ; } } , title : 'Print' } ) ; printDialog . dialog ( 'open' ) ; } }
Call createExportDialogCheckboxes, set button to #printDialog and open it.
Call createExportDialogCheckboxes set button to #printDialog and open it .