def open_print_dialog(self, *data): if (self.has_selection()): text = self.get_selected_text() else: text = self.get_text() print_dialog.print_with_action( text, print_dialog.print_with_action.PRINT_DIALOG)
def print_preview(self, *data): if (self.has_selection()): text = self.get_selected_text() else: text = self.get_text() print_dialog.print_with_action(text, print_dialog.print_with_action.PREVIEW)
def print_to_pdf(self,*data): save_file = file_chooser.FileChooserDialog(_("Enter the file name"), file_chooser.FileChooserDialog.SAVE,macros.supported_pdf_formats,macros.user_home_path) response = save_file.run() if response == file_chooser.FileChooserDialog.ACCEPT: if (self.has_selection()): text = self.get_selected_text() else: text = self.get_text() print_dialog.print_with_action(text,print_dialog.print_with_action.EXPORT, save_file.get_filename()) save_file.destroy()
def print_to_pdf(self,*data): save_file = file_chooser.FileChooserDialog(_("Enter the file name"), file_chooser.FileChooserDialog.SAVE,macros.supported_pdf_formats,macros.home_dir) response = save_file.run() if response == file_chooser.FileChooserDialog.ACCEPT: if (self.has_selection()): text = self.get_selected_text() else: text = self.get_text() print_dialog.print_with_action(text,print_dialog.print_with_action.EXPORT, save_file.get_filename()) save_file.destroy()
def open_print_dialog(self,*data): if (self.has_selection()): text = self.get_selected_text() else: text = self.get_text() print_dialog.print_with_action(text,print_dialog.print_with_action.PRINT_DIALOG)
def print_preview(self,*data): if (self.has_selection()): text = self.get_selected_text() else: text = self.get_text() print_dialog.print_with_action(text,print_dialog.print_with_action.PREVIEW)