Extracting pages from a document and saving them as a new file in C#

The first and foremost question in your mind could be, is it about PDF documents only? And the answer is, No. In this blog post we will see how simple yet helpful it is to extract pages from different kinds of documents (e.g. Word, Excel, Presentation, PDF, HTML, RTF) and save them as a new file using GroupDocs.Merger for .NET. Learn more about the supported file formats. Hence, the resultant document will possess only extracted pages.

Is there any software installation needed?
GroupDocs.Merger for .NET is a back-end API that can be integrated in any existing or new .NET application (e.g. ASP.NET, Windows form, Console). It doesn’t matter if MS Office or any PDF reader is installed on your computer or not. API doesn’t rely on any third party tool or software.

How simple is it?
The following code sample demonstrates how to extract document pages by specifying exact page numbers:

The following code sample demonstrates how to extract document pages by specifying page numbers range:

Below is the source PDF with 13 pages. Suppose we want to extract two pages only (1, 3) and create new PDF.

Output PDF will look like this:

You can get API from the download section. If you face any issue, post it on forum.