gpt4 book ai didi

java - 我们如何从 SWING 应用程序打印文档

转载 作者:太空宇宙 更新时间:2023-11-04 08:56:33 25 4
gpt4 key购买 nike

我们有 Swing 应用程序。它包括文档(PDF、MSWord文档)我们可以从我们的程序中调用系统的打印对话框来打印该文档吗?

目标操作系统是Windows XP。

而且,这是不可能的,我们如何从java处理PDF并打印PDF?

最佳答案

您可以尝试java.awt.Desktop类(需要 Java 6)(如果您的平台支持)。
如果文件类型已在系统中注册,它有一个 print 方法用于打印文件(文档)。

Prints a file with the native desktop printing facility, using the associated application's print command.

关于java - 我们如何从 SWING 应用程序打印文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2184188/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com