Hello,
We are having some issues wuth merging two documents, one is a pdf form that most likely causing some issues. The code is below. The intial files and result file are attached. The 456789-docs-merged.pdf is the final merged document.
string _temporaryFilePath = @"Conversion";
List<string> temporaryPdfFiles = new List<string>();
List<string> temporaryFinalFiles = new List<string>();
List<string> documentsTypes = new List<string>();
string mergedDocFiles = string.Empty;
string completedFile = string.Empty;
string coverPageFileName = string.Empty;
Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();
pdfLicense.SetLicense(@"Aspose.Total.License.txt");
Aspose.Pdf.Facades.PdfFileEditor pdfEditor = new Aspose.Pdf.Facades.PdfFileEditor();
//return the documents types to list on the cover page later
List<String> documents = new List<string>();
documents.Add(@"MHCCAC_Intake_Form_2 4_test1.pdf");
documents.Add(@"PDFDocumentSample.pdf");
temporaryPdfFiles.AddRange(documents);
// merge documents (in display order)
mergedDocFiles = string.Format("{0}\\{1}-docs-merged.pdf", _temporaryFilePath, 123456789);
//clean up, if the filename we are about to save exists, delete it
if (File.Exists(mergedDocFiles))
Oaccac.Dms.FileSystem.FileHelper.Delete(mergedDocFiles);
//merge documents
pdfEditor.Concatenate(temporaryPdfFiles.ToArray(), mergedDocFiles);