How to run external executables from an Appharbor application (HTML to PDF generation)?

浪尽此生 提交于 2019-12-10 16:01:51

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/9084552/how-to-run-external-executables-from-an-appharbor-application-html-to-pdf-gener

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!