Updated: The original implementation was not thread safe. The expectation was that the working directory would not change within one ruby process. This doesn’t work well in a multi-threaded environment like SideKiq. Now absolute paths are used instead of assuming the current working directory is for one PDF generation.
<img src=“https://travis-ci.org/avarteqgmbh/artex.png?branch=master” alt=“Build Status” />
Project homepage (FAQ, manual, documentation, contact info): github.com/avarteqgmbh/artex
Source repository at: github.com/avarteqgmbh/artex
-
pdflatex executable, available in modern teTeX distributions
-
Requires Ruby
For each action you want to render pdf from, add a file, for example ‘app/views/products/show.pdf.rtex`. Additionally, you need a layout with the same extensions, which should contain the whole LaTeX preamble and yield within the {document}.
This gem has been forked from the rtex gem (github.com/bruce/rtex). RTeX can be used either as stand alone executable or as a rails plugin. Using it as rails plugin means to create PDF files using the rails rendering engine. This will bring you in trouble if you don’t want to generate your PDF files within controllers. In contrast to that ArTeX has no dependencies on ActionPack and thus can also be used in models.
We’ll keep on updating the gem and we’ll try to provide some examples in the future. Besides of that the code will be iteratively cut down, rewritten and enhanced.