Welcome to the Developer Guide for the GroupDocs.Merger Document Merger Plugins. This section provides practical code examples to help you quickly integrate the plugins into your own projects.
Prerequisites
Before proceeding, please review the following topics:
Each example in this guide is provided as a self-contained code snippet. Instructions are provided below to help you run them in your development environment.
The examples save their results to an output folder in the current directory. The folder is created automatically. See Saving Output Documents to learn how output paths work.
Sample Files
Alongside each code example, you’ll find downloadable input and output files:
Source files are the input files used in the example.
Output files are generated using a valid license and are free of evaluation messages. When an example produces several documents, they are packed into a ZIP archive.
How to Run a Code Example
Below is a walkthrough of how to run a code example, using a basic merge PDF scenario. The same approach applies to all other examples.
Step 1: Create a Folder
Open your terminal and run:
mkdir merge-pdf-files
cd merge-pdf-files
Step 2: Create a .NET Console App
Use the .NET CLI to create a console application in your preferred language:
dotnet new console
dotnet new console -lang "VB"
dotnet new console -lang "F#"
Step 3: Install GroupDocs.Merger.LowCode Package
Install the package via the .NET CLI:
dotnet add package GroupDocs.Merger.LowCode
Step 4: (Optional) Set License Keys
You can either copy your license file to the application folder or use the license keys sent to you when you request or purchase a license. Metered license keys must be issued for the plugin you use; see Licensing.
This example (and others in this section) reads license keys from environment variables: GD_PUBLIC_KEY and GD_PRIVATE_KEY.
Replace the contents of your Program file with the example code below.
usingSystem;usingGroupDocs.Merger.Domain.Options;usingGroupDocs.Merger.LowCode;// Load license keysvarpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY");varprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY");// Apply the licenseLicense.Set(publicKey,privateKey);// Append the cost analysis to the business planvarmerger=newJoinPdf("business-plan.pdf",new[]{"cost-analysis.pdf"},newJoinOptions());// Save the merged documentmerger.Save("output/business-plan-with-costs.pdf");
ImportsSystemImportsGroupDocs.Merger.Domain.OptionsImportsGroupDocs.Merger.LowCodeModuleProgramSubMain()' Load license keys
DimpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY")DimprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY")' Apply the license
License.Set(publicKey,privateKey)' Append the cost analysis to the business plan
DimmergerAsNewJoinPdf("business-plan.pdf",{"cost-analysis.pdf"},NewJoinOptions())' Save the merged document
merger.Save("output/business-plan-with-costs.pdf")EndSubEndModule
openSystemopenGroupDocs.Merger.Domain.OptionsopenGroupDocs.Merger.LowCode[<EntryPoint>]letmain_=// Load license keys
letpublicKey=Environment.GetEnvironmentVariable("GD_PUBLIC_KEY")letprivateKey=Environment.GetEnvironmentVariable("GD_PRIVATE_KEY")// Apply the license
License.Set(publicKey,privateKey)// Append the cost analysis to the business plan
letmerger=JoinPdf("business-plan.pdf",["cost-analysis.pdf"],JoinOptions())// Save the merged document
merger.Save("output/business-plan-with-costs.pdf")0