Merge two pdf files


#1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.ComponentModel;
using System.Threading.Tasks;

namespace PdfFileMerging
{
public class MergePdfFile:CodeActivity
{
[Category(“Input”)]
[RequiredArgument]
public InArgument InputFilePath1 { get; set; }

    [Category("Input")]
    [RequiredArgument]
    public InArgument<string> InputFilePath2 { get; set; }

    [Category("Input")]
    [RequiredArgument]
    public InArgument<string> OutputFilePath { get; set; }

    [Category("Input")]
    [RequiredArgument]
    public InArgument<string> Input1 { get; set; }

    [Category("Input")]
    [RequiredArgument]
    public InArgument<string> Input2 { get; set; }

    protected override void Execute(CodeActivityContext context)
    {
        String filePath1 = InputFilePath1.Get(context);
        String filePath2 = InputFilePath2.Get(context);
        String filePath3 = OutputFilePath.Get(context);
        string emp1 = Input1.Get(context);
        string emp2 = Input2.Get(context);
        string[] inputFiles = new string[] { filePath1, filePath2 };
        if (emp1 == emp2)
        {


            using (Bytescout.PDFExtractor.DocumentMerger merger = new Bytescout.PDFExtractor.DocumentMerger("demo", "demo"))
            {
                merger.Merge(inputFiles, filePath3);
            }

        }
    }
}

}