diff --git a/include/aprintbar.h b/include/aprintbar.h new file mode 100755 index 000000000..e74fd0b97 --- /dev/null +++ b/include/aprintbar.h @@ -0,0 +1,19 @@ +BUTTON DLG_PRINT 2 2 +BEGIN + PROMPT 1 1 "Stampa" + PICTURE TOOL_PRINT +END + +BUTTON DLG_SETPRINT 2 2 +BEGIN + PROMPT 2 1 "Imposta" + PICTURE TOOL_SETPRINT +END + +BUTTON DLG_PREVIEW 2 2 +BEGIN + PROMPT 3 1 "~Anteprima" + PICTURE TOOL_PREVIEW +END + +#include \ No newline at end of file diff --git a/include/reprint.cpp b/include/reprint.cpp index 2815d3fd0..227dc4429 100755 --- a/include/reprint.cpp +++ b/include/reprint.cpp @@ -1649,6 +1649,8 @@ bool TBook::init() { int size; _rcd = xvt_print_create_by_name(&size, XVT_PDF_PRINTER_NAME); + if (_pw > _ph) // width > height -> landscape + xvt_app_escape (XVT_ESC_SET_PRINTER_INFO, _rcd, &_ph, &_pw, &_pvr, &_phr); // } else _rcd = printer().get_printrcd(); @@ -1671,7 +1673,7 @@ bool TBook::init() delete _printwin; _printwin = new TWindow_printer(_rcd, _pdf_file); - return true; + return _printwin->win() != NULL_WIN; } @@ -1858,20 +1860,17 @@ bool TBook::split_file_if_needed() bool TBook::main_loop() { - _print_aborted = true; - if (!init()) - return false; - - if (_pageto < _pagefrom) - _pageto = pages(); - - _print_aborted = false; - for (word copy = 0; copy < _copies && !_print_aborted; copy++) + _print_aborted = !init(); + + if (!_print_aborted) { - for (size_t page = _pagefrom; page <= _pageto && !_print_aborted; page++) + if (_pageto < _pagefrom) + _pageto = pages(); + + for (word copy = 0; copy < _copies && !_print_aborted; copy++) { - if (!print_page( *_printwin, page)) - _print_aborted = true; + for (size_t page = _pagefrom; page <= _pageto && !_print_aborted; page++) + _print_aborted = !print_page(*_printwin, page); } }