[Rev 03] RFR: 8208169: can not print selected pages of web page

Kevin Rushforth kcr at openjdk.java.net
Tue Jun 16 00:31:03 UTC 2020


On Mon, 15 Jun 2020 05:22:48 GMT, Bhawesh Choudhary <github.com+4208131+bhaweshkc at openjdk.org> wrote:

>> Print function of WebEngine.java ignores page range setting and prints given number of pages starting from first page,
>> which is the root cause of this issue. To fix it, put check for page ranges and if it available, use it for printing
>> pages otherwise print all pages as usual.
>
> Bhawesh Choudhary has updated the pull request incrementally with one additional commit since the last revision:
> 
>   cleanup unused variable

Both the fix and the test look good. I left a couple minor formatting / style comments.

modules/javafx.web/src/main/java/javafx/scene/web/WebEngine.java line 1615:

> 1614:         JobSettings jobSettings = job.getJobSettings();
> 1615:         if(jobSettings.getPageRanges() != null) {
> 1616:             PageRange[] pageRanges = jobSettings.getPageRanges();

Minor: space after `if`.

tests/manual/printing/PrintPageRangeTest.java line 83:

> 82:         htmlStringBuilder.append("<html><head></head><body>");
> 83:         for(int i = 0; i < 500; ++i) {
> 84:             htmlStringBuilder.append("<p> HTML Line No. ");

Minor: space after `for`

tests/manual/printing/PrintPageRangeTest.java line 122:

> 121:
> 122:     private void SetMessage(String msg) {
> 123:         bottomMessageLabel.setText(msg);

Minor: usual naming convention is for an initial lower-case letter.

-------------

PR: https://git.openjdk.java.net/jfx/pull/222


More information about the openjfx-dev mailing list