如何在喷墨打印机上用python打印pdf。 [英] how to print pdf with python on a inkjet printer.

查看:263
本文介绍了如何在喷墨打印机上用python打印pdf。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我正在开发一个基于ncurses的python应用程序,需要

才能创建用于打印的pdf报告。

我是不使用py -qt或wx python。

这是一个基于consol的ui应用程序,我需要制作一份pdf报告

并将其发送给lazer或者墨水喷墨打印机。

是否有可能使用python?

或者我必须使用wxpython库假设

有一个打印对话框,可以打开打印机列表?

如果wx python和gui是唯一的方式然后它就可以了但是我想要

保留这个在ncurses方面申请。


谢谢。

Krishnakant。

hello all.
I am developing an ncurses based python application that will require
to create pdf reports for printing.
I am not using py--qt or wx python.
it is a consol based ui application and I need to make a pdf report
and also send it to a lazer or ink jet printer.
is it possible to do so with python?
or is it that I will have to use the wxpython library asuming that
there is a print dialog which can open up the list of printers?
if wx python and gui is the only way then it is ok but I will like to
keep this application on the ncurses side.

thanks.
Krishnakant.

推荐答案

krishnakant Mane < re ********** @ gmail.comwrote:
"krishnakant Mane" <re**********@gmail.comwrote:

>
大家好。
我正在开发一个基于ncurses的python应用程序,需要
创建pdf报告才能打印。
我没有使用py-qt或wx python。
它是一个基于consol的ui应用程序,我需要制作一份pdf报告
并将其发送到激光打印机或喷墨打印机。
是否可以使用python进行操作?
>
hello all.
I am developing an ncurses based python application that will require
to create pdf reports for printing.
I am not using py--qt or wx python.
it is a consol based ui application and I need to make a pdf report
and also send it to a lazer or ink jet printer.
is it possible to do so with python?



制作PDF很容易。从 www.reportlab.org 获取ReportLab。我认为它是最好的Python PDF解决方案。


打印更复杂,因为你实际上需要一些东西可以

RENDER PDF。最常见的此类渲染器是Acrobat Reader,并且您可以从命令行实际调用Acrobat Reader,并使用

参数告诉它自动打印文件。唯一的

缺点是使用该方法只会打印到默认

打印机。

Making the PDF is easy. Go get ReportLab from www.reportlab.org. I
consider it the best Python PDF solution.

Printing is more complicated, because you actually need something that can
RENDER the PDF. The most common such renderer is the Acrobat Reader, and
you can actually call the Acrobat Reader from a command line with a
parameter that tells it to print the file automatically. The only
disadvantage is that using that method will only print to the "default"
printer.


>或者我是否必须使用wxpython库假设
有一个打印对话框可以打开打印机列表?
>or is it that I will have to use the wxpython library asuming that
there is a print dialog which can open up the list of printers?



即使你有打印机清单,你会用它做什么?

-

Tim Roberts, ti**@probo.com

Providenza& Boekelheide,Inc。

Even if you got the list of printers, what would you do with it?
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.




krishnakant Mane写道:

krishnakant Mane wrote:

hello all。

我正在开发一个基于ncurses的python应用程序,需要

才能创建用于打印的pdf报告。

我没有使用py - qt或者是wx python。

这是一个基于consol的ui应用程序,我需要制作一份pdf报告

并将其发送到lazer或喷墨打印机。

是否有可能使用python?

或者我必须使用wxpython库假设

有一个打印对话框可以打开打印机列表吗?

如果wx python和gui是唯一的方法那么它可以,但我想

将此应用程序保留在ncurses端。
hello all.
I am developing an ncurses based python application that will require
to create pdf reports for printing.
I am not using py--qt or wx python.
it is a consol based ui application and I need to make a pdf report
and also send it to a lazer or ink jet printer.
is it possible to do so with python?
or is it that I will have to use the wxpython library asuming that
there is a print dialog which can open up the list of printers?
if wx python and gui is the only way then it is ok but I will like to
keep this application on the ncurses side.



假设你在类UNIX系统上,你真的需要设置CUPS

< http://www.cups。 org /(或者可能是你的系统已经提供CUPS)。

PDF似乎是UNIX打印的未来中间格式

< http://www.linux。 com / article.pl?sid = 06/04/18 / 2114252和CUPS已经

支持打印PDF文件,只需运行lp your_file.pdf即可。打印

文件。 CUPS只有命令行界面:

< http://www.cups.org/documentation.php/options.html>


- Leo

Assuming you are on a UNIX-like system, you really need to setup CUPS
<http://www.cups.org/(or may be your system already provides CUPS).
PDF seems to be the future intermediate format for UNIX printing
<http://www.linux.com/article.pl?sid=06/04/18/2114252and CUPS already
supports printing PDF files, just run "lp your_file.pdf" to print a
file. CUPS only have command line interface:
<http://www.cups.org/documentation.php/options.html>

-- Leo


Leo Kislov写道:
Leo Kislov wrote:

CUPS只有命令行界面:

< http://www.cups.org/documentation.php/options.html>
CUPS only have command line interface:
<http://www.cups.org/documentation.php/options.html>



我的错误:CUPS实际上有官方的C API

< http://www.cups.org/documentation.php/api -cups.htmland非官方的

python绑定< http://freshmeat.net/projects/pycups/>。

My mistake: CUPS actually has official C API
<http://www.cups.org/documentation.php/api-cups.htmland unofficial
python bindings <http://freshmeat.net/projects/pycups/>.


这篇关于如何在喷墨打印机上用python打印pdf。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆