1. Home
  2. /
  3. GroupDocs.Merger.LowCode
  4. /
  5. Developer Guide

Developer Guide

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:

We recommend requesting a Temporary License to evaluate the plugins without limitations.

Code Examples

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.

To set them:

set GD_PUBLIC_KEY=your_public_key
set GD_PRIVATE_KEY=your_private_key
$env:GD_PUBLIC_KEY = "your_public_key"
$env:GD_PRIVATE_KEY = "your_private_key"
export GD_PUBLIC_KEY="your_public_key"
export GD_PRIVATE_KEY="your_private_key"

Step 5: Copy the Code Example

Replace the contents of your Program file with the example code below.

using System;
using GroupDocs.Merger.Domain.Options;
using GroupDocs.Merger.LowCode;

// Load license keys
var publicKey = Environment.GetEnvironmentVariable("GD_PUBLIC_KEY");
var privateKey = Environment.GetEnvironmentVariable("GD_PRIVATE_KEY");

// Apply the license
License.Set(publicKey, privateKey);

// Append the cost analysis to the business plan
var merger = new JoinPdf("business-plan.pdf", new[] { "cost-analysis.pdf" }, new JoinOptions());

// Save the merged document
merger.Save("output/business-plan-with-costs.pdf");
Imports System
Imports GroupDocs.Merger.Domain.Options
Imports GroupDocs.Merger.LowCode

Module Program
    Sub Main()
        ' Load license keys
        Dim publicKey = Environment.GetEnvironmentVariable("GD_PUBLIC_KEY")
        Dim privateKey = Environment.GetEnvironmentVariable("GD_PRIVATE_KEY")

        ' Apply the license
        License.Set(publicKey, privateKey)

        ' Append the cost analysis to the business plan
        Dim merger As New JoinPdf("business-plan.pdf", {"cost-analysis.pdf"}, New JoinOptions())

        ' Save the merged document
        merger.Save("output/business-plan-with-costs.pdf")
    End Sub
End Module
open System
open GroupDocs.Merger.Domain.Options
open GroupDocs.Merger.LowCode

[<EntryPoint>]
let main _ =
    // Load license keys
    let publicKey = Environment.GetEnvironmentVariable("GD_PUBLIC_KEY")
    let privateKey = Environment.GetEnvironmentVariable("GD_PRIVATE_KEY")

    // Apply the license
    License.Set(publicKey, privateKey)

    // Append the cost analysis to the business plan
    let merger = JoinPdf("business-plan.pdf", [ "cost-analysis.pdf" ], JoinOptions())

    // Save the merged document
    merger.Save("output/business-plan-with-costs.pdf")
    0

Expected output: Download business-plan-with-costs.pdf (19 pages)

Step 6: Copy the Input Files

Download the input files business-plan.pdf and cost-analysis.pdf and place them in the project folder.

Step 7: Run the Code

Execute the app using:

dotnet run

After successful execution, business-plan-with-costs.pdf appears in the output folder of the project.

You can also download the expected output to compare.

Troubleshooting

If something doesn’t work as expected:

  • Ensure the environment variables are set correctly.
  • Confirm that the input files are placed in the correct directory.
  • See Handling Errors for the exceptions the plugins throw.
  • For more help, visit the Technical Support page.