Demo: print image with a little JavaScript
var imageSrc = "data:image/png;base64,"+ggbApplet.getPNGBase64(5, false);
var props = ggbApplet.getViewProperties()
var imgHtml="<img style='padding:50px 50px;display:block;margin-left:auto;margin-right:auto;width:500px;height:auto;' src='"+imageSrc+"'></img>";
var WindowObject = window.open('', 'PrintWindow', 'width=1200,height=800,top=50,left=50,toolbars=no,scrollbars=yes,status=no,resizable=yes');
var strHtml = "<html>\n<head>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"test.css\">\n</head><body onload='window.print();window.close()'><div style=\"testStyle\">\n" + imgHtml + "\n</div>\n</body>\n</html>";
WindowObject.document.writeln(strHtml);
WindowObject.document.close();
WindowObject.focus();