V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2018-07-22 17:03:22 +08:00 · 1996 次点击
    这是一个创建于 2077 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    如图

    图片

    6 条回复    2018-07-26 22:08:06 +08:00
    wxg4net
        1
    wxg4net  
       2018-07-22 17:20:51 +08:00
    可能是默认的打印机驱动参数不正确造成的。在初始化 printer 的时候,你可能根据你的纸张重新设定参数。参考 http://timgolden.me.uk/pywin32-docs/PRINTER_DEFAULTS.html
    whatsupbitch
        2
    whatsupbitch  
    OP
       2018-07-22 20:26:05 +08:00
    @wxg4net 谢谢 我看一下
    ysc3839
        3
    ysc3839  
       2018-07-23 01:55:22 +08:00 via Android
    我建议找个 C/C++ 的代码测试成功后翻译到 Python。
    whatsupbitch
        4
    whatsupbitch  
    OP
       2018-07-23 21:07:54 +08:00
    @ysc3839 谢谢 ~~ 我到网上找一下
    qile1
        5
    qile1  
       2018-07-23 22:30:44 +08:00 via Android
    格式简单就用 raw pcl
    打印原始语言组一个!我也在寻找 python 打印方式
    转 PDF 或者 txt 都麻烦,你打印内容多不?
    whatsupbitch
        6
    whatsupbitch  
    OP
       2018-07-26 22:08:06 +08:00
    @qile1 我主要打印快递单~~ 内容不少。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5150 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 09:33 · PVG 17:33 · LAX 02:33 · JFK 05:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.