In this article we are going to cover how to merge PDFs together with C# and .NET Core with just a few lines of code using the Api2Pdf dotnet client library. Api2Pdf is a REST API that makes it super easy to generate and combine PDFs. You can view the full documentation of the dotnet client library on Github here, but here we will only focus on merging PDFs together.
Run the nuget command
Install-Package Api2Pdf
In order to use the Api2Pdf merge endpoints, you must first acquire an API key. Register at https://portal.api2pdf.com to get your API key. It only takes a minute.
Replace “YOUR-API-KEY” with the key you acquired from Step 2. Grab some URLs to existing PDFs and place them in the list, using the sample code below. If you do not have any links to PDFs handy, you can use the two below:
http://www.api2pdf.com/wp-content/uploads/2018/11/b82dee70-e6e4-11e8-9744-7936761eca6f.pdf
http://www.api2pdf.com/wp-content/uploads/2018/11/e51b48f0-e6e5-11e8-ac0c-b90d0913ce75.pdf
var a2pClient = new Api2Pdf("YOUR-API-KEY");
var links_to_pdfs = new List() {"https://LINK-TO-PDF", "https://LINK-TO-PDF"};
var apiResponse = a2pClient.Merge(links_to_pdfs);
Print your apiResponse to see the result. The url to your PDF will be in the Pdf attribute of the response object.
That’s it! Merging PDFs together only took a few minutes and required no complicated tools.
Tags: combine pdfs .net core, combine pdfs api, combine pdfs c#, concatenate pdfs .net core, concatenate pdfs api, concatenate pdfs c#, merge pdfs, merge pdfs .net core, merge pdfs api, merge pdfs aws lambda, merge pdfs azure functions, merge pdfs c#, merge pdfs dotnet, merge pdfs serverlessComments are closed.