Using PDF and Excel API with Azure Cloud Functions
GrapeCity Documents are fast and efficient APIs that can provide full control of your Excel and PDF documents. GrapeCity Documents for Excel is a server-side spreadsheet API, that can generate, load, save, convert, calculate, format, parse, and export spreadsheets without having MS Excel dependencies.
GrapeCity Documents for PDF is a server-side PDF API, that can generate, load, edit, and save PDF documents. This high-speed, feature-rich PDF document API for .NET Core gives you total control of your PDF documents, with no dependencies on Adobe Acrobat.
The APIs are written in .NET Core, making them platform agnostic. You can use GcDocs in your desktop, browser, and mobile applications (within the norms of a .NET ecosystem).
This article discusses the process of using GrapeCity Documents APIs with Azure Functions, Microsoft's serverless architecture.
Azure Functions allow developers to quickly write a lean API (by auto-scaling on demand and by removing the hassle of designing a server's architecture).
Using GrapeCity Documents with Azure functions
- Open Visual Studio.
- Update/ Install Azure Functions and Web Jobs Tools for Visual Studios.
- Create a new project GrapeCityDocsAzFunc by selecting, Visual C# > Cloud > Azure Functions.
- Open NuGet Package Manager, search GrapeCity.Documents, and install the packages: GrapeCity.Documents.Pdf and GrapeCity.Documents.Excel.
- Create an HTTP-triggered Azure function and name it GenerateExcel and add the content from the following code:
- Create an HTTP-triggered Azure function and name it GeneratePdf. Add the content from the following code:
- Run your project and see the results. Your links should look like this:
http://localhost:7071/api/GenerateExcel?name=John
http://localhost:7071/api/GeneratePdf?name=Jane
Note: these links will work from your project while debugging.
There are many additional features that can be programmed using GrapeCity Documents APIs. For more information, a complete feature list, and to download a free trial, please visit GrapeCity Documents.