Code:
Private Sub MergeMultiplePDFIntoSinglePDF(ByVal outputFilePath As String, ByVal pdfFiles As String())
Dim document As PdfDocument = New PdfDocument()
For Each pdfFile As String In pdfFiles
Dim inputPDFDocument As PdfDocument = PdfReader.Open(pdfFile, PdfDocumentOpenMode.Import)
document.Version = inputPDFDocument.Version
For Each page As PdfPage In inputPDFDocument.Pages
document.AddPage(page)
Next
'System.IO.File.Delete(pdfFile) '被防毒軟體擋下來,以後再改
Next
document.Options.CompressContentStreams = True
document.Options.NoCompression = False
document.Save(outputFilePath)
End Sub