When I try to package the following files I get error when I open the package
Package1.pdf: A.pdf & B.pdf
Package2.pdf: A.pdf & C.pdf
Package3.pdf: A.pdf & D.pdf
I am using the following code
//Instantiate PdfFileEditor object
PdfFileEditor pdfEditor = new PdfFileEditor();
//Call Concatenate method of PdfFileEditor object to concatenate all input streams into a single output stream
bool merged = pdfEditor.Concatenate(InputFiles, OutputFile);
// open the file to get the stream
Stream PdfFile;
//Instantiating PdfFileSecurity object
PdfFileSecurity fileSecurity = new PdfFileSecurity(OutputFile, EncryptedOutputFile);
//Calling EncryptFile method to encrypt the PDF document
//Way2: Based on a predefined privilege and change some specifical permissions.
DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
privilege.AllowCopy = true;
privilege.AllowPrint = true;
privilege.AllowFillIn = true;
privilege.AllowScreenReaders = true;
privilege.AllowModifyContents = false;
privilege.AllowModifyAnnotations = true;
bool encrypted = fileSecurity.SetPrivilege("", "ownerpassword", privilege);
if (!encrypted)
throw new ApplicationException("Unable to encrypt input files");
// open the file to get the stream
PdfFile = File.OpenRead(EncryptedOutputFile);
PackageByteArray = WebHelper.ReadStream(PdfFile, 1000);
PdfFile.Close();
return PackageByteArray;
//Instantiate PdfFileEditor object
PdfFileEditor pdfEditor = new PdfFileEditor();
//Call Concatenate method of PdfFileEditor object to concatenate all input streams into a single output stream
bool merged = pdfEditor.Concatenate(InputFiles, OutputFile);
// open the file to get the stream
Stream PdfFile;
//Instantiating PdfFileSecurity object
PdfFileSecurity fileSecurity = new PdfFileSecurity(OutputFile, EncryptedOutputFile);
//Calling EncryptFile method to encrypt the PDF document
//Way2: Based on a predefined privilege and change some specifical permissions.
DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
privilege.AllowCopy = true;
privilege.AllowPrint = true;
privilege.AllowFillIn = true;
privilege.AllowScreenReaders = true;
privilege.AllowModifyContents = false;
privilege.AllowModifyAnnotations = true;
bool encrypted = fileSecurity.SetPrivilege("", "ownerpassword", privilege);
if (!encrypted)
throw new ApplicationException("Unable to encrypt input files");
// open the file to get the stream
PdfFile = File.OpenRead(EncryptedOutputFile);
PackageByteArray = WebHelper.ReadStream(PdfFile, 1000);
PdfFile.Close();
return PackageByteArray;
Please open the package files to see the errors