Merging multiple PDF files into a single file

Posted in: General vb.NET
By dePoPo
Nov 5, 2009 - 4:41:34 PM

This code sample shows how to merge multiple PDF files into a single one.

You need to download the Toolbox version 1.1.0.0 or later, and add a reference to your project.

        Dim s_targetfile As String = My.Computer.FileSystem.SpecialDirectories.Desktop & "\target.pdf"

        Dim s_sourcefiles As String() = {My.Computer.FileSystem.SpecialDirectories.Desktop & "\file1.pdf", _
                                          My.Computer.FileSystem.SpecialDirectories.Desktop & "\file2.pdf", _
                                          My.Computer.FileSystem.SpecialDirectories.Desktop & "\file3.pdf"}

        Dim mypdftool As New ToolBox.PDFWorker
        mypdftool.parm_ApplicationName = "Demo Application"
        mypdftool.parm_Author = ""
        mypdftool.parm_Keywords = "Demo, PDF Merge"
        mypdftool.parm_Subject = "Demo file merged from multiple source files"

        Cursor.Current = Cursors.WaitCursor
        mypdftool.MergePdfFiles(s_sourcefiles, s_targetfile)
        Cursor.Current = Cursors.Default


Visitor Comments