从 LaTeX 源创建 PDF 的 Java 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13036995/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java library to create PDF from LaTeX source
提问by Edward Ruchevits
I have Java program, which receives some data and generates LaTeX document.
我有 Java 程序,它接收一些数据并生成 LaTeX 文档。
I need Java library to create PDF file from generated LaTeX source.
我需要 Java 库来从生成的 LaTeX 源创建 PDF 文件。
Could you recommend me something, please?
你能给我推荐一些东西吗?
回答by Joel Berger
I agree with kurtzbot, LaTeX compilers are sophisticated pieces of software which cannot reasonably be rewritten in Java or any other language. If it were it would be a massive effort. To my knowledge there isn't even a C library implementing the compiler, one must us a command line program.
我同意 kurtzbot 的观点,LaTeX 编译器是复杂的软件,无法用 Java 或任何其他语言合理地重写。如果是这样,那将是一项巨大的努力。据我所知,甚至没有实现编译器的 C 库,我们必须使用命令行程序。
This is not to say that there aren't libraries which manage a build process, probably via system calls and monitoring temporary files (from the LaTeX build). For example, I know there is latexmkwhich performs such a task. If someone has made a Java implementation like it, I would bundle a LaTeX compiler and that manager into your program.
这并不是说没有管理构建过程的库,可能是通过系统调用和监视临时文件(来自 LaTeX 构建)。例如,我知道有Latexmk可以执行这样的任务。如果有人制作了类似的 Java 实现,我会将 LaTeX 编译器和该管理器捆绑到您的程序中。