#if GTK3
- print("PNG not supported in webkit2\n");
- return;
+ GLib.Timeout.add_seconds(webkitpdf.opt_delay, () => {
+ print("delay done URL: %s\n", this.el.uri);
+ this.printpng();
+ return false;
+ }, GLib.Priority.DEFAULT);
+ return;
#else
GLib.Timeout.add_seconds(webkitpdf.opt_delay, () => {
print("making screenshot\n");
#if GTK3
+ GLib.MainLoop mainloop = new GLib.MainLoop();
+ _this.view.el.get_snapshot.begin(WebKit.SnapshotRegion.FULL_DOCUMENT, WebKit.SnapshotOptions.NONE, null, (obj, res) => {
+ var sf = _this.view.el.get_snapshot.end(res);
+ sf.write_to_png(webkitpdf.opt_target_png);
+ print("Saved to %s\n", webkitpdf.opt_target_png);
+ mainloop.quit();
+
+ });
+
+ mainloop.run();
#else
// fix vapi - get_snapshot add '?' to all null.
// sf.write_to_png(Browser.opt_target_png);
//});
+ #endif
this.delete_cookiefile();
+
Gtk.main_quit();
- #endif
+