[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing system - alternative proposal for pdf output

Hi Istvan,

I am a little bit frustrated to get full utf-8 pdf output support from lsmb

I guess you're not alone. It's definitely a tough topic.

I am able to use xedemo templates with xelatex, here are my experiences:

  • editing xelatex templates is a horror story, especially if someone not expert in *tex,
  • seems utf-8 support does not work out of the box (which is interesting, because the Hungarian sql-ledger fork is working without issue, only thing is needed in the template: \usepackage[utf8x]{inputenc}
If you need to use the inputenc package with your (la)tex, then you're using LaTeX, not XeLaTeX. You could try editing the LaTeX templates and use those instead of using xelatex.
  • somehow generating pdf with xelatex incredibely slow, comparing to the previous solution

I made a little research around the following topic: how to create pdf from html, with utf-8 support. After checking some theories (cups-pdf, html2ps), I found the following:

  • wkhtmltopdf (usually part of the distribution)
  • how to use example: wkhtmltopdf invoice-VSZ10001.html invoice.pdf

It is fast, supports utf-8, just works in one comfortable step.

You're forgetting a major advantage: with this solution, we need to maintain only a single set of templates and can scratch the LaTeX and XeLaTeX versions.

So, my proposal is to consider implementing an alternative pdf output, using wkhtmltopdf. The source is the html template but the output is pdf in one quick step. The result is really fine, except it is necessary to edit almost all of the layouts, because surprisingly I found that, html layouts needs serious changes to get good result.

There are a few disadvantages as well, though:

* wkhtmltopdf uses Webkit to generate the PDF; webkit is a pretty heavy solution - so we're not replacing a heavy solution with a lightweight solution; rather one heavy one with another
* If you *are* a (Xe)LaTeX wizzard, the output generated by (Xe)LaTeX looks a lot nicer than what has been shown to be possible in HTML
* As you pointed out yourself later, wkhtmltopdf might depend on people's X libraries being installed which is a pretty heavy solution for headless systems running webservers.

The above being noted, I have to say I went to do the same reseach you have just finished a few months back, because - as you - I run into the problem that I think designing LaTeX templates is both too complex for regular/non-tech/non-latex users. However, when discussing the subject with Chris, he was concerned to break existing setups as well as replacing one very heavy solution with another.

My conclusion would be that if we want to support both, we probably need a good way for the admin to select one option or the other, with autodetection logic to see if various options are available on the server.



http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.