Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim filePaths As String() = System.IO.Directory.GetFiles(path) For Each fileName As [String] In filePaths Dim targetFolder As String = path Dim fi As New System.IO.FileInfo(fileName) 'fi.CopyTo(System.IO.Path.Combine(path, (fi.Name) & ".pdf"), True) Label1.Text = filePaths.Length alList.Add(fileName) Next CombineReport(alList, path) End Sub Public Shared Function CombineReport(ByVal pdfFiles As IList, ByVal pdfFile As String) As String Try Dim sb As New System.Text.StringBuilder() For Each o As Object In pdfFiles sb.Append(o.ToString()) sb.Append(" ") Next sb.AppendFormat("cat output {0} allow printing dont_ask", pdfFile) System.Diagnostics.Process.Start("C:\WINDOWS\system32\pdftk", sb.ToString()).WaitForExit() Return pdfFile Catch ex As Exception Throw ex End Try End Function End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)