How to deploy a PDF API to Azure in 6 steps
GrapeCity Documents for PDF is a high-speed, low-footprint PDF document API that allows you to generate, modify, load, and save PDFs easily in your .NET apps. For your cloud-based apps, here's how to deploy GC Docs for PDF in your Azure apps in 6 steps.
Step 1: Create a new ASP.NET Core MVC app
First, in Visual Studio, go to File > New > Project, and select ASP.NET Core Web Application. In the wizard that opens, select Web Application (Model-View-Controller).
Step 2: Add reference to GrapeCity.Documents.Pdf
Next, go to Dependencies > Manage NuGet Packages, and install the GrapeCity.Documents.Pdf package.
Step 3: Clean up the Index.cshtml page
Clean up the Index.cshtml page so that it contains only this code. This step is optional, as our controller will send PDF content for this page.
Step 4: Modify HomeController.cs
Modify HomeController.cs to generate the 'Hello, World!' PDF. The code should look like this:
Modify the Index() method like so:
Step 5: Try it
From Visual Studio, run your app locally to make sure everything works. You should see the "Hello, World!" PDF opening in your default web browser.
Step 6: Publish the app to Azure
Finally, go to to Build > Publish, create a new 'Microsoft Azure App Service' publish profile, select the appropriate name, subscription details, etc.; the defaults should work just fine.