推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
whatsupbitch
V2EX  ›  Python

[求助] 关于 win32api 打印,上边总是空出一个区域

  •  
  •   whatsupbitch · Jul 22, 2018 · 2889 views
    This topic created in 2878 days ago, the information mentioned may be changed or developed.

    代码是参照 http://timgolden.me.uk/python/win32_how_do_i/print.html Single image: use PIL and win32ui 这一章节 应该是某个地方缺少一个设置,但是找了半天文档找不到,Google 也没有找到。看看有没有大神知道的?

    如图

    图片

    6 replies    2018-07-26 22:08:06 +08:00
    wxg4net
        1
    wxg4net  
       Jul 22, 2018
    可能是默认的打印机驱动参数不正确造成的。在初始化 printer 的时候,你可能根据你的纸张重新设定参数。参考 http://timgolden.me.uk/pywin32-docs/PRINTER_DEFAULTS.html
    whatsupbitch
        2
    whatsupbitch  
    OP
       Jul 22, 2018
    @wxg4net 谢谢 我看一下
    ysc3839
        3
    ysc3839  
       Jul 23, 2018 via Android
    我建议找个 C/C++ 的代码测试成功后翻译到 Python。
    whatsupbitch
        4
    whatsupbitch  
    OP
       Jul 23, 2018
    @ysc3839 谢谢 ~~ 我到网上找一下
    qile1
        5
    qile1  
       Jul 23, 2018 via Android
    格式简单就用 raw pcl
    打印原始语言组一个!我也在寻找 python 打印方式
    转 PDF 或者 txt 都麻烦,你打印内容多不?
    whatsupbitch
        6
    whatsupbitch  
    OP
       Jul 26, 2018
    @qile1 我主要打印快递单~~ 内容不少。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1212 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:40 · PVG 01:40 · LAX 10:40 · JFK 13:40
    ♥ Do have faith in what you're doing.