How Rotativa.io works

Rotativa.io brings generating PDF files with the ease and control of Rotativa to the Microsoft Azure cloud infrastructure. Let’s see how it works.

Rotativa.io brings generating PDF files with the ease and control of Rotativa to the Microsoft Azure cloud infrastructure. Let’s see how it works.

Using Rotativa.io is really simple, but to achieve this simplicity a smart and complex architecture has been built using the best resources available in Microsoft Azure.

4 October 2016 Update: This document is based on the .Net client implementation. The PHP client will work similarly, except that the HTML generation is left to the PHP developer to implement, see here for details. Instead, this will apply only partially if you are using the API directly with your own code. In this case only the Rotativa.io side will be relevant.

TLTR. For those not willing to go through all the steps below we could simply explain the process with:
Rotativa.io takes your view and model, turns it into a PDF and transparently sends your user to Azure storage to securely and privately download it.

The following image represents all steps taken by the Rotativa.io solution to generate PDF files.

illustration
  • Step 1
  • Step 2
  • Step 3
  • Step 4
  • Step 5
  • Step 6
  • Step 7

Step 1

A user requests a PDF file from your web app server.

Step 2

You server issues a request to Rotativa.io sending the HTML to be converted. For requests made using the .Net package, the .Net core package or the PHP client, the HTML is sent in a package with all the assets needed, like CSS files, images, fonts, js files.

Step 3

Rotativa.io renders the HTML (either using assets in the package or by retreiving them) and turns it into a PDF file. It stores it in Azure storage as a temporary file.

Step 4

Rotativa.io communicates the temporary PDF file URL to your server.

Step 5

Your server redirects the user to Azure storage for a secure and private download.

Step 6

User downloads the PDF file from Azure storage over HTTPS with the filename configured in the ViewAsPdf call. URL works for 2 minutes.

Step 7

Rotativa.io systems persist logging data and counters and delete the temporary PDF file.