def METHOD_NAME(self):
    printer = QPrinter()
    dlg = QPrintDialog(printer, self)
    dlg.setWindowTitle(app.caption(_("Print")))
    options = (QAbstractPrintDialog.PrintToFile
               | QAbstractPrintDialog.PrintShowPageSize
               | QAbstractPrintDialog.PrintPageRange)
    if self.browser.textCursor().hasSelection():
        options |= QAbstractPrintDialog.PrintSelection
    dlg.setOptions(options)
    if dlg.exec_():
        self.browser.METHOD_NAME(printer)