I will have to receive permission to get you the PDF files. Hopefully I can get that to you in my next response. In the meantime, below is a snippet of the code I use to retrieve the file locations to put into the string array. The code is for VB.NET on an ASPX page. There is a Datagrid with two columns of check boxes that the user checks, which tells the function what PDFs they would like to look at. The cover page is created in a prior function.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
The function simply creates a list of file locations that get put into a String Array.
To verify what the problem is that I am facing is that if I pick a bunch of smaller sized PDFs, the concatenate will work until the combined size of the PDFs reaches around 50,000KB. I can do any combination of the smaller sized PDFs if the combined sizes of the files are around 50,000KB or less. The problem changes if I choose from the larger sized PDFs. Most of the time when I try to combine the large file with my cover page it does not want to work. I have had it work with the largest of the files once in a great while.
Imports Aspose.Pdf.Kit
Private Sub MergeTheFiles()
Dim license As Aspose.Pdf.Kit.License = New Aspose.Pdf.Kit.License
license.SetLicense("C:\Inetpub\wwwroot\PortalVBVS\Fixed_Process_Filing\bin\Aspose.Pdf.Kit.Lic")
'Instantiate PdfFileEditor object
Dim pdfEditor As PdfFileEditor = New PdfFileEditor
Dim objItem As DataGridItem
Dim TabName As String
Dim myCheckBox As CheckBox
Dim PenCheckBox As CheckBox
Dim SeeTab As Boolean
Dim SeePending As Boolean
Dim Counter As Integer = 0
Dim FileInfo As New ArrayList
Dim FilePathway As String
Dim StoreStringLocations As New ArrayList
Call CreateTempForViewFolder()
Dim BuiltPath As String = "\\aceprecision.com\dfs-root\data\AceFiling\ViewPDF\" & Viewstate("CurrentSessionId") & "\"
For Each objItem In SelectTabTG.Items
If objItem.ItemType <> ListItemType.Header And objItem.ItemType <> ListItemType.Footer And objItem.ItemType <> ListItemType.Pager Then
myCheckBox = CType(objItem.Cells(3).FindControl("Tabs"), CheckBox)
PenCheckBox = CType(objItem.Cells(4).FindControl("Pending"), CheckBox)
TabName = objItem.Cells(1).Text.Trim
If Not PenCheckBox Is Nothing Then
SeePending = PenCheckBox.Checked
If SeePending = True Then
If Counter <> 0 Then
FilePathway = "\\aceprecision.com\dfs-root\data\AceFiling\Fixed_Processes\" & PartNumberLB.Text.Trim & "\Pending\" & TabName & ".PDF"
StoreStringLocations.Add(FilePathway)
Counter = Counter + 1
Else
FilePathway = "\\aceprecision.com\dfs-root\data\AceFiling\ViewPDF\" & Viewstate("CurrentSessionId") & "\CoverPage.PDF"
StoreStringLocations.Add(FilePathway)
FilePathway = "\\aceprecision.com\dfs-root\data\AceFiling\Fixed_Processes\" & PartNumberLB.Text.Trim & "\Pending\" & TabName & ".PDF"
StoreStringLocations.Add(FilePathway)
Counter = Counter + 1
End If
End If
SeeTab = myCheckBox.Checked
If SeeTab = True Then
If Counter <> 0 Then
FileInfo.Clear()
FileInfo = FixedProcessConnections.GetFileLocationAndFileNameWithPartRevAndTabName(PartNumberLB.Text.Trim, RevisionLB.Text.Trim, TabName)
FilePathway = "\\aceprecision.com\dfs-root\data\AceFiling\Fixed_Processes\" & PartNumberLB.Text.Trim & "\" & FileInfo(0) & "\" & FileInfo(1) & ".PDF"
StoreStringLocations.Add(FilePathway)
Counter = Counter + 1
Else
FilePathway = "\\aceprecision.com\dfs-root\data\AceFiling\ViewPDF\" & Viewstate("CurrentSessionId") & "\CoverPage.PDF"
StoreStringLocations.Add(FilePathway)
FileInfo.Clear()
FileInfo = FixedProcessConnections.GetFileLocationAndFileNameWithPartRevAndTabName(PartNumberLB.Text.Trim, RevisionLB.Text.Trim, TabName)
FilePathway = "\\aceprecision.com\dfs-root\data\AceFiling\Fixed_Processes\" & PartNumberLB.Text.Trim & "\" & FileInfo(0) & "\" & FileInfo(1) & ".PDF"
StoreStringLocations.Add(FilePathway)
Counter = Counter + 1
End If
End If
End If
End If
Next
Dim TheFilesToMerge(StoreStringLocations.Count - 1) As String
For i As Integer = 0 To StoreStringLocations.Count - 1
TheFilesToMerge(i) = StoreStringLocations(i)
Next
pdfEditor.Concatenate(TheFilesToMerge, "\\aceprecision.com\dfs-root\data\AceFiling\ViewPDF\" & Viewstate("CurrentSessionId") & "\FullDoc.PDF")
End Sub
Hopefully I can get you the PDF files or substitutes within the week.
Thank you for all your help.