4

I have a requirement to produce PDF's for one my .Net web applications currently hosted on Appharbor.

Traditionally, I would simply install latex on the machine, and create PDF's on the fly with pdflatex. This requirement is to display sections in HTML to end users, but also have a downloadable PDF - so it's slightly different.

I have found several (free) external HTML to PDF converters which may be applicable in this instance. However, I haven't found any libraries allowing me to do this purely programatically.

What advice would you give if I plan to continue using Appharbor?

Should I set up a seperate EC2 (or similar) instance to run such an application from? Or is there a better alternative?

dazbradbury
  • 5,729
  • 5
  • 34
  • 38

2 Answers2

3

I'd recommend using something like DocRaptor. Note that you can probably continue with your current scheme if you place the relevant pdflatex executable (and it doesn't require the entire Latex runtime) alongside the code you push to AppHarbor. AppHarbor will also be introducing background workers, which might be a good fit for this sort of work.

friism
  • 19,068
  • 5
  • 80
  • 116
  • I did not realise I would be able to call an executable from an AppHarbor hosted solution. I just assumed it would be a security concern and locked down. As Such, I am now using a system similar to this to do the legwork: http://stackoverflow.com/a/3683756/892397 Thanks for the heads up, you saved me a huge headache in terms of architecture! – dazbradbury Feb 01 '12 at 15:51
1

Note that if you're trying to use Rotativa or using wkhtmltopdf with routes obtained from HttpContext you'll need to use this workaround:

http://support.appharbor.com/kb/getting-started/workaround-for-generating-absolute-urls-without-port-number

or install the premotion fix from Nuget:

https://github.com/trilobyte/Premotion-AspNet-AppHarbor-Integration

DarylChymko
  • 1,048
  • 1
  • 8
  • 11