I am currently rewriting our document production system from using a full-featured PDF library to using Aspose components for various business reasons. We have already purchased a licence for all Aspose components.
However I am having trouble reproducing functionality using the Aspose components. One of the issues that I am having is the apparently unnecessary split between Aspose.PDF and Aspose.PDF.Kit.
The current issue that I am having is attempting to reproduce the functionality to concatenate multiple documents into a single PDF stream. The process is to load multiple pdf forms into memory, populate them using a datasource, concatenate them into a single PDF document inserting blank pages to ensure correct duplex printing and then stream the resulting document to the client. There doesn't seem to be any way to do this with the current Aspose components. The existing component does not differentiate between PDF documents and PDF Form documents. Therefore I can populate the document and then modify it using a single class.
Here is the code I use with the existing component.
' Append the document to the end of the composite document.
Dim copyPages As ArrayList = New ArrayList
Dim pEnd As PageIterator = newPdfDoc.PageEnd()
Dim pItr As PageIterator = newPdfDoc.PageBegin()
While Not pItr.Equals(pEnd)
If (pItr.GetPageNumber() >= Me.StartPage) And _
(pItr.GetPageNumber() <= Me.EndPage Or Me.EndPage = 0) Then
copyPages.Add(pItr.Current())
End If
pItr.Next()
End While
Dim importedPages As ArrayList = pdf.ImportPages(copyPages)
For page As Integer = 0 To importedPages.Count - 1
pdf.PagePushBack(importedPages(page))
Next
' Ensure we alweays append an even number of pages when duplex printing
If m_duplex And pdf.GetPagesCount Mod 2 = 1 Then
pdf.PagePushBack(form.PageCreate())
End If