using iTextSharp.text.pdf;
using System.IO;
// Get the array of input PDF file names from the input argument
string[] pdfFiles = inputFiles;
// Set the name of the output PDF file
string outputFileName = outputFiles;
// Create a new PdfCopy object to write the merged PDF document
FileStream outputStream = new FileStream(outputFileName, FileMode.Create);
PdfCopy copy = new PdfCopy(outputStream);
foreach (string inputFile in pdfFiles)
{
// Create a PdfReader object for the current input file and add its pages to the PdfCopy object
PdfReader reader = new PdfReader(inputFile);
copy.AddDocument(reader);
// Close the PdfReader object for the current input file
reader.Close();
}
// Close the PdfCopy object and the output stream
copy.Close();
outputStream.Close();
// Get the array of input PDF file names from the input argument
string[] pdfFiles = inputFiles;
// Set the name of the output PDF file
string outputFileName = outputFiles;
// Create a new PdfCopy object to write the merged PDF document
System.IO.FileStream outputStream = new System.IO.FileStream(outputFileName, FileMode.Create);
iTextSharp.text.pdf.PdfCopy copy = new iTextSharp.text.pdf.PdfCopy(outputStream);
foreach (string inputFile in pdfFiles)
{
// Create a PdfReader object for the current input file and add its pages to the PdfCopy object
iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(inputFile);
copy.AddDocument(reader);
// Close the PdfReader object for the current input file
reader.Close();
}
// Close the PdfCopy object and the output stream
copy.Close();
outputStream.Close();
its just a trial code for understanding invoke code pros and cons and capablities , just trying diffrent scenarios to be coverd in invoke code activity, and the issue was resolved by adding the itextsharp pakage from pakage explorer/manage pakage