Hi,
Since the release of Sierra 10.12.4, the users of Sweet Home 3D sandboxed version can't print anymore.
This Java program simply hangs on the call to PrinterJob#printDialog under this system, but there's no problem on previous systems or when the program isn't sandboxed.
I isolated this issue in the following example that will hang also:
import java.awt.Graphics;
import java.awt.print.*;
import javax.swing.JOptionPane;
public class PrintTest {
public static void main(String [] args) {
PrinterJob printerJob = PrinterJob.getPrinterJob();
printerJob.setPrintable(new Printable() {
public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
// Print one empty page
return pageIndex == 0 ? PAGE_EXISTS : NO_SUCH_PAGE;
}
});
JOptionPane.showMessageDialog(null, "setPrintable works!");
if (printerJob.printDialog()) {
try {
printerJob.print();
JOptionPane.showMessageDialog(null, "PrinterJob works!");
} catch (PrinterException e) {
JOptionPane.showMessageDialog(null, "PrinterJob exception: " + e);
}
}
}
}Entitlements are set as following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-/
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.print</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>Any suggestion why this could happen and how to fix it?
Thanks for your help,
Emmanuel