Hello,
Problem Fixed!
This did turn out to be an issue with the trial version and I am now able to do this using a purchased version of the software.
New Issue
I however have another issue that is related to this same problem. I am using version 7.9.0. When I concatenate multiple pdf documents that have “Extended Rights” the extended rights feature is not preserved.
I have tried this using file paths and file streams. This however creates a new pdf document without the extended rights feature.
I have also tried adding the pages from one document to another. When I do this I get the following message when I open the pdf document.
“This document enabled extended feature in Adobe Reader. The document has been changed since it was created and use of the extended feature is no longer available. Please contact the author for the original version of this document.”
Is there anyway to preserve the extended rights when concatenating documents?
I have included some sample test code and have attached 3 Adobe PDF forms that have “Extended Rights” for you to test with.
// TEST 1
string input1 = @“inputFile1.pdf”;
string input2 = @“inputFile2.pdf”;
string output = @“output.pdf”;
Aspose.Pdf.Facades.PdfFileEditor pdfEditor = new Aspose.Pdf.Facades.PdfFileEditor();
pdfEditor.Concatenate(“inputfile1”, “inputfile2”, “outputfile”);
// TEST 2
string inputfile1 = @“inputFile1.pdf”;
string inputfile2 = @“inputFile2.pdf”;
string outputfile = @“output.pdf”;
using (System.IO.FileStream input1Stream = new System.IO.FileStream(inputfile1, System.IO.FileMode.Open))
using (System.IO.FileStream input2Stream = new System.IO.FileStream(inputfile2, System.IO.FileMode.Open))
using (System.IO.FileStream outputStream = new System.IO.FileStream(outputfile, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite))
{
System.IO.FileStream[] inputStream2 = new System.IO.FileStream[2];
inputStreams[0] = input1Stream;
inputStreams[1] = input2Stream;
//create PdfFileEditor object
Aspose.Pdf.Facades.PdfFileEditor pdfEditor4 = new Aspose.Pdf.Facades.PdfFileEditor();
//concatenate file
pdfEditor4.Concatenate(inputStreams, outputStream);
}
// TEST 3
string outputFile = @“inputFile1.pdf”;
string inputFile = @“inputFile2.pdf”;
using (System.IO.FileStream inputStream = new System.IO.FileStream(inputFile, System.IO.FileMode.Open))
using (System.IO.FileStream outputStream = new System.IO.FileStream(outputFile, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite))
{
Document outputDocument = new Document(outputStream);
Document inputDocument = new Document(inputStream);
outputDocument.Pages.Add(inputDocument.Pages);
outputDocument.Save();
}