# Merge PDF Learn how to merge PDF files, combine PDF files into one file programmatically in C# language using GroupDocs.Merger for .NET library. ## How to merge PDF files in C\# [GroupDocs.Merger](https://products.groupdocs.com/merger/net) allows developers to merge PDF files when it's needed to organize multiple PDF files into single document or send fewer attachments etc. And you can do this without any third-party software or manual work involved. With GroupDocs.Merger it is possible to combine PDF documents of any size and structure - all text, images, tables, graphs, forms and other content will be preserved. The following example demonstrates how to merge PDF files with several lines of C# code: * Create an instance of [Merger](https://reference.groupdocs.com/merger/net/groupdocs.merger/merger) class and pass source PDF file path as a constructor parameter. You may specify absolute or relative file path as per your requirements. * Add another PDF file to merge with [Join](https://reference.groupdocs.com/merger/net/groupdocs.merger/merger/join) method. Repeat this step for other PDF documents you want to merge. * Call [Merger](https://reference.groupdocs.com/merger/net/groupdocs.merger/merger) class [Save](https://reference.groupdocs.com/merger/net/groupdocs.merger/merger/save) method and specify the filename for the merged PDF file as parameter. ```csharp // Load the source PDF file using (Merger merger = new Merger(@"c:\sample1.pdf")) { // Add another PDF file to merge merger.Join(@"c:\sample2.pdf"); // Merge PDF files and save result merger.Save(@"c:\merged.pdf"); } ``` ### How to merge PDF files with bookmarks in C\# Also, there is an ability to merge Pdf files with bookmarks, please see an according example below: ```csharp // Load the source PDF file using (Merger merger = new Merger(@"c:\sample1.pdf")) { // Init PdfJoinOptions with UseBookmarks flag PdfJoinOptions pdfJoinOptions = new PdfJoinOptions(); pdfJoinOptions.UseBookmarks = true; // Add another PDF file to merge merger.Join(@"c:\sample2.pdf", pdfJoinOptions); // Merge PDF files and save result merger.Save(@"c:\merged.pdf"); } ``` ### How to correctly merge PDF streams in C\# You can read the following article: [How to correctly merge PDF streams]({{< ref "merger/net/getting-started/use-cases/how-to-correctly-merge-documents-using-csharp.md" >}}) ### About PDF File Format Portable Document Format (PDF) is a type of document created by Adobe back in the 1990s. The purpose of this file format was to introduce a standard for representation of documents and other reference material in a format that is independent of application software, hardware as well as Operating System. PDF files can be opened in Adobe Acrobat Reader/Writer as well in most modern browsers like Chrome, Safari, Firefox via extensions/plug-ins. ### Code Examples Please find more [use-cases and complete C# sources]({{< ref "merger/net/showcases.md" >}}) of our backend and frontend examples and try them for free! ### Merge PDF Live Demo GroupDocs.Merger for .NET provides an online [**PDF Merger App**](https://products.groupdocs.app/merger/pdf), which allows you to try it for free and check its quality and accuracy. [!["Merge PDF"](https://docs.groupdocs.com/merger/net/images/merge/merge-pdf.png)](https://products.groupdocs.app/merger/pdf)