4

I need a utility that can be called from an automation script to convert a CSS-styled HTML document to PDF. The twist is that I want to add page numbers for all the sections in the table of contents (and a page number in the footer of each page).

A colleague found a utility called Prince which does this, but it's pretty expensive--$3800 for a server license, or $495 per user, per machine.

Is there any FOSS alternative, or even some other commercially-available alternative which is less expensive; say, closer to the range of $100 per user or perhaps even $500 for a floating license?

4

DocRaptor is a hosted version of PrinceXML. It has a much less upfront cost than Prince, although sometimes fixed costs are advantageous (client projects, etc). Test documents are always free at DocRaptor.

Note: I work at DocRaptor.

  • 1
    Thanks; this looks like a good fit for us since we don't have to convert very many documents. I've gotten a trial and am testing it out with a colleague, and after working out a couple issues the results look promising. – rob Jun 19 '15 at 0:37
1

pandoc can produce pdfs from a wide viriety of formats including HTML, (some sites pages better than others - beware ones with restricted fonts), via latex and if invoked with the --toc flag will embed in the latex instructions to generate a table of contents which should include page numbers once it has been rendered into a PDF by pdflatex|lualatex|xelatex - recommended for Windows is MikTeX.

You can also either accept the default footer, with the -s flag, or you can design your own template(s).

Pandoc is a command line utility and a Haskel library so you should have no problems calling from a script.

Both Pandoc and MikTex are free and open source. Pandoc is cross platform and will work with LaTeX engines on other platforms as well as with MikTex on Windows.

  • Thanks for the suggestion. I asked a colleague to look into this and it seems like it will require more effort to integrate this into our build process and tweak the output than the DocRaptor solution, but I think others who are looking for a strictly FOSS alternative will find the pandoc+TeX solution useful. – rob Jun 19 '15 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.