Merge PDF with C# REST API

This short tutorial guides how to merge PDF with C# REST API. You will learn to merge all PDFs with C# REST Interface using the SDK. It will explain all the steps required to develop the application for combining multiple PDF files.

Prerequisite

Steps to Combine PDF with C# Low Code API

  1. Set API key and SID for initializing the PdfApi class object
  2. Create the MergeDocuments object and provide the list of PDF files that you want to merge
  3. Upload all the source PDF files using the UploadFile() method in the PdfApi class
  4. Call the PutMergeDocuments() method to merge all the PDF files into a single destination PDF file
  5. Download and save the output PDF file containing the contents of all the merged PDF files

These steps summarize how to merge PDF online with C# REST API. Use the MergeDocuments class object to create the list of PDF files that you want to merge, and upload all these PDF files to the cloud using the PdfApi.UploadFile() method, and invoke the PutMergeDocuments() method to merge the PDF files online. The API call returns the status OK whereafter you may call the DownloadFile method to retrieve the output PDF file.

Code to Combine PDF Files with C# .NET-based API

This code has taught us how to concatenate PDF files with the C# REST Interface. Use the similar names in the UploadFile() method as used in the list of PDF files in the MergeDocuments object. When you download the resultant PDF file, set the Position parameter to zero otherwise you will not be able to save the file on the disk.

This article has explained how to merge PDF documents online with C# .NET-based API. To create an empty PDF file, refer to the following article: Create a PDF Document with NET REST API.

 English