How to run external executables from an Appharbor

2019-06-25 09:38发布

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?

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-06-25 10:00

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.

查看更多
乱世女痞
3楼-- · 2019-06-25 10:03

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

查看更多
登录 后发表回答