TabbedBrowser.js
[app.wkmirror] / BrowserView.js
index 4817cc9..0a0b337 100644 (file)
@@ -134,13 +134,22 @@ BrowserView = new GType({
         {
             print("load finished");
             
-            GLib.timeout_add(GLib.PRIORITY_LOW, 5000, function() {
+            GLib.timeout_add(GLib.PRIORITY_LOW, 1000, function() { 
+                 
                 var mf = _t.get_main_frame();
+                
+                var ar = Gtk.PaperSize.get_paper_sizes();
+                var psetup = new Gtk.PageSetup();
+                for(var i = 0; i < ar.length; i++) {
+                    if (ar[i].get_name() =='iso_a2') {
+                        psetup.set_paper_size(ar[i]);
+                    }
+                }
+                
                 var p = new Gtk.PrintOperation({ export_filename : '/home/chris/test_pdf/test2.pdf' });
-
-                print(mf.print_full(p, Gtk.PrintOperationAction.EXPORT));
-                Gtk.main_quit;
-//                Seed.quit;
+                p.set_default_page_setup(psetup);
+                mf.print_full(p, Gtk.PrintOperationAction.EXPORT)
+                //Seed.quit();
             });
             
             return;
@@ -329,7 +338,7 @@ BrowserView = new GType({
 
         // Implementation
         //this.set_scroll_adjustments(null, null);
-
+        
         this.signal.title_changed.connect(update_title);
         this.signal.load_committed.connect(load_committed);
         this.signal.load_finished.connect(load_finished);
@@ -343,6 +352,7 @@ BrowserView = new GType({
 
         this.signal.create_web_view.connect(create_new_tab);
         
+        
          
         print("ADDing console message sig handler");