[NZLUG] Converting UTF-8 files to PDF

Félix Saparelli felix at passcod.name
Tue Apr 1 17:24:20 NZDT 2014


After a bit of experimenting, the most versatile solution I found is to use
`lp` directly to print a file. CUPS handles text, ps, pdf on its own, so if
you configure (or have configured, check with `lpstat -p -d`) a PDF
printer, you can use that directly. Output is in /var/spool/cups-pdf by
default. There are many options. Here's a nice cheatsheet:
http://www.eecs.utk.edu/resources/it/kb/printing/linux-command-line

There is also `unoconv` which can convert to/from anything LO/OO handles.

On 1 April 2014 17:04, Félix Saparelli <felix at passcod.name> wrote:

> Overkill solution that's still less overkill than LO/OO: wkhtmltopdf. Wrap
> the file with <html><body><pre>the file</pre></body></html>, give it to the
> tool, and you'll get a pdf. Of course, more advanced HTML formatting can be
> used.
>
> Less overkill solution: pandoc.
>
> I'm sure there's more and easier tools.
>
>
> On 1 April 2014 16:41, Volker Kuhlmann <hidden at paradise.net.nz> wrote:
>
>> On Tue 01 Apr 2014 16:28:32 NZDT +1300, DL Neil wrote:
>>
>> > I guess OO/LO is not going to meet those final criteria.
>> > (you probably know can be API-ed from Python, etc).
>>
>> Cranking up a word processor for a plain text file always seems very
>> wrong, but is better than nothing. Margin control should be possible
>> with that, but the scripting of OO/LO always looks very painful to me.
>>
>> Before going down that route, using kate would work, but I don't know
>> how that can be scripted.
>>
>> Ideally I was hoping something similar to enscript might exist that can
>> also handle unicode...
>>
>> Thanks,
>>
>> Volker
>>
>> --
>> Volker Kuhlmann                 is list0570 with the domain in header.
>> http://volker.top.geek.nz/      Please do not CC list postings to me.
>> _______________________________________________
>> NZLUG mailing list
>> NZLUG at lists.nzoss.org.nz
>> http://lists.nzoss.org.nz/mailman/listinfo/nzlug
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nzoss.org.nz/pipermail/nzlug/attachments/20140401/b74a8280/attachment.html>


More information about the NZLUG mailing list