前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >python之打印机

python之打印机

作者头像
py3study
发布2020-01-09 16:22:49
1.9K0
发布2020-01-09 16:22:49
举报
文章被收录于专栏:python3python3

AGG(Anti-Grain Geometry)Anti-Grain Geometry (AGG) is an Open Source, free of charge graphic library, written in industrially standard C++. The terms and conditions of use AGG are described on The License page. AGG doesn't depend on any graphic API or technology. Basically, you can think of AGG as of a rendering engine that produces pixel images in memory from some vectorial data. But of course, AGG can do much more than that. The ideas and the philosophy of AGG are:

Anti-Grain Geometry - About the Project  http://www.antigrain.com/about/index.html

QPrinter Class | Qt Print Support 5.10  http://doc.qt.io/qt-5/qprinter.html

代码语言:javascript
复制
from PyQt5 import QtWidgets, QtPrintSupport 
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMainWindow, QTableWidgetItem, QTabWidget, QFileDialog, QMessageBox
from PyQt5.QtGui import QTextDocument
from QtPrintSupport import  QPrinter
代码语言:javascript
复制
    @pyqtSlot()
    def on_pushButton_print_clicked(self):
        print("dsddsdsdsddssd")
        QPrinter(printer) 
        printer.setPageSize(0)
        printer.setOutputFormat(1)
        filepath = QFileDialog.getSaveFileName(this, tr("保存为..."), tr("D://成绩.pdf"), tr("PDF格式(*.pdf)"))
        printer.setOutputFileName(filepath)
        QTextDocument(textDocument)
        textDocument.setHtml(MakeDataToHtml())
        textDocument.print(printer)
        QMessageBox.about(this, tr("提示"), tr("保存成功"))
代码语言:javascript
复制
        print("dsddsdsdsddssd")
        printer=QPrinter() 
        printer.setPageSize(0)
        printer.setOutputFormat(1)
        filepath = QFileDialog.getSaveFileName(self, "保存为...", "D://成绩.pdf", "PDF格式(*.pdf)")
        print("ddddddddddddd", filepath)
        printer.setOutputFileName(str(filepath))
        textDocument=QTextDocument()
        textDocument.setHtml("dsdftrrrrrrergerr")
        textDocument.print(printer)
        QMessageBox.about(self, "提示", "保存成功")

from PyQt5 import QtWidgets, QtPrintSupport 

Python调用打印机参考例子 - 宁静的天空 - 博客园  https://www.cnblogs.com/ribavnu/p/4790262.html

Qt实现保存、浏览、预览、打印功能 - CSDN博客  https://blog.csdn.net/zbw1185/article/details/52184961

使用QPrinter生成pdf或用打印机打印数据 - 恒月美剑 - 博客园  https://www.cnblogs.com/jck34/p/4107885.html

QT表格打印_百度文库  https://wenku.baidu.com/view/82e1e7b669dc5022aaea0024.html点击打开链接

QT 打印的简单实现(转)_北极孤星_新浪博客  http://blog.sina.com.cn/s/blog_63578f1401013ars.html

python3+PyQt5 实现文档打印功能 - CSDN博客  https://blog.csdn.net/xiaoyangyang20/article/details/68941555

(转)用AGG实现高质量图形输出(一) - 3D入魔 - 博客园  http://www.cnblogs.com/mazhenyu/p/3911690.html

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-08-27 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档