找不到通过python显示和打印pdf的方法。 [英] can't find a way to display and print pdf through python.

查看:153
本文介绍了找不到通过python显示和打印pdf的方法。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我遇到了一个奇怪的要求。

我需要一个可以帮助我显示pdf文件的库作为报告和

还想要一种方法在一个独立的平台上打印相同的pdf文件

方式。

如果那是不可能的那么我至少需要代码使用一些

库连接到acrobat reader并在windows上给出打印命令

和ubuntu linux上类似的东西。

问题是我想在我的应用程序中显示报告。

用户应该能够在屏幕上查看格式化的报告,并在他的

选项中点击屏幕上的打印按钮将其发送到打印机。

我安装了reportlab,这足以生成pdf报告。

但是我仍然不能直接显示它并直接打印它。

请帮帮我。

Krishnakant。

hello all,
I am stuck with a strange requirement.
I need a library that can help me display a pdf file as a report and
also want a way to print the same pdf file in a platform independent
way.
if that''s not possible then I at least need the code for useing some
library for connecting to acrobat reader and giving the print command
on windows and some thing similar on ubuntu linux.
the problem is that I want to display reports in my application. the
user should be able to view the formatted report on screen and at his
choice click the print button on the screen to send it to the printer.
I have reportlab installed and that is sufficient to generate pdf reports.
but I still can''t fine the way to display it directly and print it directly.
Please help me.
Krishnakant.

推荐答案

您是否尝试:

a )在它的默认应用程序中打开PDF文件?

b)用Python创建PDF阅读器?


....因为你的问题有点不清楚。报告实验室没有PDF查看器。

你需要一个PDF / PostScript解析器才能做到这一点,这比我想象的更像是一份工作

寻找。
Are you trying to:
a) Make the PDF file open in it''s default application?
b) Create a PDF-reader in Python?

....because your question is somewhat unclear. Report Lab has no PDF viewer.
You would need a PDF/PostScript parser to do that and that''s more of a job
than I think you''re looking for.


好的,

我需要在线查看报告,并在我的应用程序中打印它们。

所以是的我需要在我的应用程序中显示pdf并打印它。

问候。

Krishnakant
well yes,
I need to view reports on line and also print them from within my app.
so yes I need to display the pdf in my app and print it as well.
regards.
Krishnakant

krishnakant Mane写道:
krishnakant Mane wrote:

hello all,

我遇到了一个奇怪的要求。

我需要一个可以帮助我显示pdf文件作为报告的图书馆和

也想要一种在独立平台上打印相同pdf文件的方法

方式。 br />
如果不可能那么我至少需要使用一些

库来连接到acrobat reader并给出打印命令的代码

在Windows上和ubuntu linux上类似的东西。

问题是我想在我的应用程序中显示报告。

用户应该能够在屏幕上查看格式化的报告,并在他的

选项中点击屏幕上的打印按钮将其发送到打印机。

我安装了reportlab,这足以生成pdf报告。

但是我仍然不能直接显示它并打印它

直接。

请帮帮我。

Krishnakant。
hello all,
I am stuck with a strange requirement.
I need a library that can help me display a pdf file as a report and
also want a way to print the same pdf file in a platform independent
way.
if that''s not possible then I at least need the code for useing some
library for connecting to acrobat reader and giving the print command
on windows and some thing similar on ubuntu linux.
the problem is that I want to display reports in my application. the
user should be able to view the formatted report on screen and at his
choice click the print button on the screen to send it to the printer.
I have reportlab installed and that is sufficient to generate pdf reports.
but I still can''t fine the way to display it directly and print it
directly.
Please help me.
Krishnakant.



只需让注册的.PDF查看器为您完成。


os.start(''myfile.pdf' ')


启动注册为.PDF查看器和用户的任何内容

可以自行打印,保存,缩放等。


-Larry

Just let the registered .PDF viewer do it for you.

os.start(''myfile.pdf'')

Launches whatever is registered as .PDF viewer and user
can then print, save, zoom, etc. on their own.

-Larry


这篇关于找不到通过python显示和打印pdf的方法。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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