Bug 572319 - [Printer] Printer class draws blank pages
Summary: [Printer] Printer class draws blank pages
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.19   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-25 22:01 EDT by Tobiel Gaspi CLA
Modified: 2021-03-26 01:23 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobiel Gaspi CLA 2021-03-25 22:01:48 EDT
org.eclipse.swt.printing.Printer writes only blank pages after the Windows security updates on https://docs.microsoft.com/en-us/windows/release-health/windows-message-center#1574. (Dated March 18, 2021
07:00 PM PT)
 
--- Printer.java
...
Printer p = new Printer(printerData)
... // start job
GC gc = new GC(p);
// draw on GC
gc.dispose();
... // end job
---

Eventually, after p.endJob(), the printer will write only blank pages.
This only happened after the mentioned Windows update.

Is there a way to resolve this issue without applying the out-of-band security patches released by Windows?
Comment 1 Tobiel Gaspi CLA 2021-03-25 22:10:30 EDT
Additional Info:

The issue seems to happen when the following methods are called while drawing on the GC object.

org.eclipse.swt.graphics.Image#getImageData()
* If at any point this method is called on an Image that is drawn to the GC, the printout will be blank.
* This seems to contradict the documentation that modifying the ImageData will not affect the Image.
* Even if the method is simply called, and the returned ImageData object is not modified, the output of the printer will still be blank.