Merge PDFs in C#

The GdPictureDocumentConverter class is a quick and easy one-step operation for merging several documents in different formats into a single PDF document. You can also choose the PDF conformance level you require.

Here’s the code for converting files to PDF:

// We assume GdPicture has been correctly installed and unlocked.
IEnumerable<string> inputFiles = new List<string>(new string[] { "d:\\image.jpg", "d:\\document.pdf", "d:\\image.tif", "d:\\todo_list.xlsx" });
using (Stream dstStream = File.Create("d:\\merged.pdf"))
{
    using (GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter())
    {
        gdpictureDocumentConverter.CombineToPDF(inputFiles, dstStream, PdfConformance.PDF1_5);
    }
}
'We assume GdPicture has been correctly installed and unlocked.
Dim inputFiles As IEnumerable(Of String) = New List(Of String)(New String() {"d:\image.jpg", "d:\document.pdf", "d:\image.tif", "d:\todo_list.xlsx"})
Using dstStream As Stream = File.Create("d:\merged.pdf")
    Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter()
        gdpictureDocumentConverter.CombineToPDF(inputFiles, dstStream, PdfConformance.PDF1_5)
    End Using
End Using