用于在生产中生成 PDF 的 LaTeX [英] LaTeX for PDF generation in production

查看:24
本文介绍了用于在生产中生成 PDF 的 LaTeX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在读研究生时使用 LaTeX 编写了几份白皮书.就 LaTeX 允许用户做的事情而言,我对它有一个非常好的印象,尤其是它提供的对格式的精细控制等.

I used LaTeX for writing couple of white papers while I was in grad school. From that I have a really good impression about it in terms of what LaTeX allows user to do, especially the fine control it provides over formatting, etc.

现在我正在讨论是否应该在我们的生产应用程序中真正使用 LaTeX 来生成 PDF.我尝试了几个商业和免费的 PDF 库(PDFSharp/MigraDoc、iTextSharp、Expert PDF 等),但它们都没有提供我需要的精细控制量,而不会使代码库长期难以维护.

Now I am debating whether I should actually use LaTeX for our production apps to generate PDFs. I have tried several commercial and free PDF libraries (PDFSharp/MigraDoc, iTextSharp, Expert PDF, etc) and none of them provide the amount of fine control I need without making the code base extremely difficult to maintain in long run.

如果我决定走这条路,它将从 C# 完成.由于 LaTeX 已经有命令行界面,我应该可以很容易地从 C# 作为从我的程序派生出来的外部进程来做到这一点.

If I do decide to go this route it will be done from C#. Since LaTeX already has command line interface, I should be able to do that pretty easily from C# as an external process forked from my program.

但我正在寻找来自社区的一些评论.

But I was looking for some comments from the community.

  1. 有人试过吗?如果是这样,有什么问题?
  2. 您如何看待这个想法 - 利弊(我对 gotachas 更感兴趣)?

欢迎所有反馈.

推荐答案

我之前构建了一个使用纯 TeX(特别是 MiKTeX implementation) 以生成 PDF 格式的报告.该平台用于每月生成大约 50 个不同性质的报告(主要包含动态生成的表格和图表).该系统非常灵活.报告通过 XML 定义(在内部定义的报告描述架构上).该平台允许用户指定源数据库表、要提取的字段、字段的格式、用于过滤适当数据的迷你查询语言以及各种格式元素(页面方向、大小、标题和分类(公开"、内部"、机密"等).

I have previously built a platform for report generation that uses plain TeX (specifically the MiKTeX implementation) to generate reports in PDF format. The platform is used to generate approximately fifty reports per month of varying nature (containing mostly dynamically generated tables and charts). The system is quite flexible. Reports are defined via XML (on an internally-defined report description schema). The platform allows the user to specify a source database table, which fields to extract, the formatting of the fields, a mini query language to filter the appropriate data as well as various formatting elements (page orientation, size, titles, and classifications ("Public", "Internal", "Confidential", etc.).

主要的陷阱"是需要大量的工作才能最终得到一个可以灵活更改且维护起来并不痛苦的代码库.第二个陷阱"是 TeX 知识(学术界以外的人)很少见,因此即使这不是您通常角色的一部分,您最终也可能成为事实上的维护者.

The main "gotcha" is that it takes a ton of work to end up with a code base that is flexible to change and not a total pain to maintain. A second "gotcha" is that knowledge of TeX (outside of academics) is rare so you could end up becoming the de facto maintainer even if that is not part of your usual role.

优点:

  1. 格式精美的报告.
  2. 完全控制布局和外观.
  3. 免费.

缺点:

  1. 难以正确实施.
  2. 难以维护.
  3. 知识转换可能会很繁重.
  4. 实际上不存在支持.

这篇关于用于在生产中生成 PDF 的 LaTeX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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