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

I have a requirement to create a PDF file for one of my .Net web applications that are currently hosted on Appharbor.

Traditionally, I just installed latex on a machine and created PDFs on the fly using pdflatex. This requirement is to display sections in HTML for end users, but also have a downloadable PDF file, so it is slightly different.

I found several (free) external HTML to PDF converters that may be applicable in this case. However, I did not find any libraries allowing me to do this purely programmatically.

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

Should I create a separate instance of EC2 (or similar) to run such an application? Or is there a better alternative?

+4
source share
2 answers

I would recommend using something like DocRaptor . Note that you can probably continue your current circuit by placing the appropriate pdflatex executable (and it does not require the entire Latex runtime) along with the code that you click on AppHarbor. AppHarbor will also represent background workers who may be suitable for this kind of work.

+3
source

Note that if you are trying to use Rotativa or use wkhtmltopdf with routes retrieved from the HttpContext, you need to use this workaround:

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

or install the premium fix from Nuget:

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

+1
source

Source: https://habr.com/ru/post/1394034/


All Articles