

USING SIDEWRITER APP PLUS
Manages response from server back to clientĮach section includes a functional and technical description of a technology, plus the details of coding and/or configuration requirements.
USING SIDEWRITER APP PDF
The table in Figure 3 presents a brief description of these technologies, and I describe them in more detail in the sections that follow.įigure 3 Technologies Used in the Solution TechnologyĪpp Service Authentication and AuthorizationĬonverts HTML to PDF, uploads PDF to Azure Storage

I’ve used numerous technologies to create the real-time HTML-to-PDF App Service Web App solution. The next few sections of this article discuss the technologies used to create the solution, and explain how you can build and utilize them. It takes very little effort to dynamically set this URL to the current page and have the button send the page to the WebJob API for conversion and download.
USING SIDEWRITER APP CODE
The example code contains an ASP.NET Web site with an index page that allows a user to enter a URL, send that Web page to get converted to a PDF and then download the PDF to a client device. The other components of the solution had already been worked out I finally had the last piece of the puzzle, as Figure 2 shows. I could call the wkhtmltopdf program from my App Service Web App using the WebJob API. WebJobs are made for exactly this situation because they can run executables either continuously or when triggered from an external source for example, manually from the Azure SDK or by using an Azure Scheduler, CRON or the Azure WebJob API ( bit.ly/1SD9gVJ). Having worked on the IIS support team for many years, I knew that making this happen even on a standalone version of IIS would require configurations that would make security analysts lose sleep. The question that remained unanswered was: “How can I get Microsoft Azure App Service Web Apps to spawn this process to create the PDF?” App Service Web Apps runs within a sandbox and I knew from the start that I couldn’t do that-there was zero possibility of having a request sent from a client machine starting and running a process on the server. I worked on different portions of this solution over the past months, but the execution of the wkhtmltopdf process stubbornly prevented me from achieving my goal.

However, running a program from a command line is a long way from real-time conversion with a button on a Web page. The best, or at least my favorite, Web page-to-PDF converter is the open source program called wkhtmltopdf ( ), which uses the command line, as shown in Figure 1.įigure 1 Running the wkhtmltopdf Converter from the Console There are numerous Web sites and open source binaries that let you do this, but I wasn’t ever able to connect all the dots and get the output I wanted in the way that I wanted it. Volume 31 Number 6 Using Azure App Services to Convert a Web Page to PDFĬonverting aWeb page to a PDF is nothing new, but my goal-to place a link on my Web site that gave visitors a simple way to convert a specific page to a PDF document in real time-turned out to be somewhat complicated.
