Ejemplo n.º 1
0
        private void PrintButtonClicked(object sender, EventArgs args)
        {
            try {
                page_breaks = new List <PageBreak> ();

                using (Gtk.PrintOperation print_op = new Gtk.PrintOperation()) {
                    print_op.JobName = Note.Title;

                    print_op.BeginPrint += OnBeginPrint;
                    print_op.DrawPage   += OnDrawPage;
                    print_op.EndPrint   += OnEndPrint;

                    print_op.Run(Gtk.PrintOperationAction.PrintDialog, Window);
                }
            } catch (Exception e) {
                Logger.Error("Exception while printing " + Note.Title + ": " + e.ToString());
                HIGMessageDialog dlg = new HIGMessageDialog(Note.Window,
                                                            Gtk.DialogFlags.Modal,
                                                            Gtk.MessageType.Error,
                                                            Gtk.ButtonsType.Ok,
                                                            Catalog.GetString("Error printing note"),
                                                            e.Message);
                dlg.Run();
                dlg.Destroy();
            }
        }
Ejemplo n.º 2
0
		private void PrintButtonClicked (object sender, EventArgs args)
		{
			try {
				page_breaks = new List<PageBreak> ();				
				
				using (Gtk.PrintOperation print_op = new Gtk.PrintOperation ()) {
					print_op.JobName = Note.Title;

					print_op.BeginPrint += OnBeginPrint;
					print_op.DrawPage += OnDrawPage;
					print_op.EndPrint += OnEndPrint;

					print_op.Run (Gtk.PrintOperationAction.PrintDialog, Window);
				}
			} catch (Exception e) {
				Logger.Error ("Exception while printing " + Note.Title + ": " + e.ToString ());
				HIGMessageDialog dlg = new HIGMessageDialog (Note.Window,
					Gtk.DialogFlags.Modal,
					Gtk.MessageType.Error,
					Gtk.ButtonsType.Ok,
					Catalog.GetString ("Error printing note"),
					e.Message);
				dlg.Run ();
				dlg.Destroy ();
			}
		}
Ejemplo n.º 3
0
        protected void OnPrintButtonClicked(object sender, System.EventArgs e)
        {
            Gtk.PrintOperation print = new Gtk.PrintOperation();
            // Tell the Print Operation how many pages there are
            print.NPages = this.pdf.NPages;

            print.BeginPrint += new Gtk.BeginPrintHandler(OnBeginPrint);
            print.DrawPage   += new Gtk.DrawPageHandler(OnDrawPage);
            print.EndPrint   += new Gtk.EndPrintHandler(OnEndPrint);

            // Run the Print Operation and tell it what it should do (Export, Preview, Print, PrintDialog)
            // And provide a parent window if applicable
            print.Run(Gtk.PrintOperationAction.PrintDialog, null);
            print = null;
        }
Ejemplo n.º 4
0
        protected void OnPrintButtonClicked(object sender, System.EventArgs e)
        {
            Gtk.PrintOperation print = new Gtk.PrintOperation ();
            // Tell the Print Operation how many pages there are
            print.NPages = this.pdf.NPages;

            print.BeginPrint += new Gtk.BeginPrintHandler (OnBeginPrint);
            print.DrawPage += new Gtk.DrawPageHandler (OnDrawPage);
            print.EndPrint += new Gtk.EndPrintHandler (OnEndPrint);

            // Run the Print Operation and tell it what it should do (Export, Preview, Print, PrintDialog)
            // And provide a parent window if applicable
            print.Run (Gtk.PrintOperationAction.PrintDialog, null);
            print = null;
        }