Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTeX for PDF generation in production

Tags:

c#

.net

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.

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.

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. Has anyone tried it? If so, what were some gotchas?
  2. What do you think about the idea -- pros and cons (I am more interested in gotachas)?

All feedback is welcome.

like image 746
codelove Avatar asked Jul 31 '09 02:07

codelove


People also ask

Can I make PDF in LaTeX?

Use the "latex" and "dvips" programs to generate a PostScript file, and then use a tool such as Acrobat or GhostScript to convert the PostScript file into PDF.

Which type of documents can be created using LaTeX?

LaTeX is most commonly used to create documents for academia, such as academic journals. In LaTeX, the author doesn't stylize the document directly, like in a word processor such as Microsoft Word, LibreOffice Writer, or Apple Pages; instead they write code in plain text that must be compiled to produce a PDF document.


1 Answers

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.).

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.

Pros:

  1. Beautifully formatted reports.
  2. Complete control over layout and look.
  3. Free.

Cons:

  1. Difficult to implement properly.
  2. Difficult to maintain.
  3. Knowledge transition could be burdensome.
  4. Support is effectively non-existant.
like image 199
jason Avatar answered Nov 13 '22 16:11

jason