--- old/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp 2016-03-11 17:32:37.964580700 +0530 +++ new/src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp 2016-03-11 17:32:37.321999100 +0530 @@ -770,6 +770,8 @@ AwtPrintControl::getMinPageID); jint maxPage = env->CallIntMethod(printCtrl, AwtPrintControl::getMaxPageID); + jint selectType = env->CallIntMethod(printCtrl, + AwtPrintControl::getSelectID); pd.nMaxPage = (maxPage <= (jint)((WORD)-1)) ? (WORD)maxPage : (WORD)-1; // In the event that the application displays the dialog before // installing a Printable, but sets a page range, then max page will be 1 @@ -779,7 +781,7 @@ // So if we detect this fix up such a problem here. if (pd.nMinPage > pd.nFromPage) pd.nMinPage = pd.nFromPage; if (pd.nMaxPage < pd.nToPage) pd.nMaxPage = pd.nToPage; - if (pd.nFromPage > pd.nMinPage || pd.nToPage < pd.nMaxPage) { + if (selectType != 0 && (pd.nFromPage > pd.nMinPage || pd.nToPage < pd.nMaxPage)) { pd.Flags |= PD_PAGENUMS; } @@ -788,8 +790,6 @@ pd.Flags |= PD_PRINTTOFILE; } - jint selectType = env->CallIntMethod(printCtrl, - AwtPrintControl::getSelectID); // selectType identifies whether No selection (2D) or // SunPageSelection (AWT)