如何从 Java 应用程序打印 PDF 文件?
最佳答案
这里有一些源代码可以让你打印任何文本文件:
public void print() {
//The desktop api can help calling other applications in our machine
//and also many other features...
Desktop desktop = Desktop.getDesktop();
try {
//desktop.print(new File("DocXfile.docx"));
desktop.print(new File("Docfile.pdf"));
} catch (IOException e) {
e.printStackTrace();
}
}
也许它适合您的需求,因为您没有提供更多细节。
关于java - 如何在 Java 应用程序中打印 PDF 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2478890/