I have two PDF files and I want to merge two PDF files in single PDF files using IronPDF (reference from https://ironpdf.com/). Here is the code I am using
var PDFs = new List<PdfDocument>();
foreach (var file in files)
{
PDFs.Add(PdfDocument.FromFile(file));
}
PdfDocument PDF = PdfDocument.Merge(PDFs);
newFileName = Path.Combine(TEMP_PDF_FILESTORE_LOCATION, newFileName);
PDF.SaveAs(newFileName);
While merging two PDF files here is the error it showing "Could not safely read page objects from AnotherPdfFile". One of PDF can contain image in that. Some image PDF it will take some throw error. How we can remove this error?