MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / doPrint

Function doPrint

vm/ByteCodeTranslator/src/javascript/browser_bridge.js:1908–1912  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1906 var win = iframe.contentWindow;
1907 try { win.addEventListener('afterprint', function() { finish(1, null); setTimeout(cleanup, 0); }); } catch (e) {}
1908 var doPrint = function() {
1909 try { win.focus(); win.print(); }
1910 catch (e) { finish(0, '' + e); cleanup(); return; }
1911 setTimeout(function() { finish(1, null); }, 1000);
1912 };
1913 if (isImage) {
1914 // Wait for the (data-URL) image to decode/paint before printing,
1915 // otherwise the print captures an empty page.

Callers 2

waitImgFunction · 0.85
browser_bridge.jsFile · 0.85

Calls 4

cleanupFunction · 0.85
finishFunction · 0.70
focusMethod · 0.65
printMethod · 0.65

Tested by

no test coverage detected