RotativaHQ supports WebApi usage and in general usage outside of Asp.net MVC web app. As we will see later this feature can be used to build the PDF from Asp.net MVC too, in case you need to access directly either the pdf or the URL pointing to the PDF (stored on the cloud and accessible for 2 minutes).
Returning PDF from WebApi is as simple as just doing:
You need to also add the using directive
Instead if you need to access the pdf binary directly you can simply call:
Finally you can just get the URL of the temporary file in the RotativaHQ cloud storage, certainly the most efficient option.