Hi,
Can you please help me to know what is fastest way to append multiple image to PDF file.
Currently I am appening 26 Image files (7 mb each) into a single page of PDF File. And it is taking around 3 minutes to process , so is there any way to optimize this processing time?
Below is my code to generate PDF.
Document Doc = new Document(“Temp.pdf”);
// Create instance of PdfFileMend class
PdfFileMend mendor = new PdfFileMend(Doc);
var ImgFiles = Directory.GetFiles("D:\\SampleImages").ToList().Where(x => x.Contains(".png"));
foreach ( string TF in ImgFiles)
{
// Text Fragment
using (FileStream FS = new FileStream(TF, FileMode.Open))
{
Stream Img = new MemoryStream();
FS.CopyTo(Img);
mendor.AddImage(Img, 1, 50, 50, 400, 400);
}
}
MemoryStream MS = new MemoryStream();
Doc.Save(MS, SaveFormat.Pdf);
Machine Configuration:
RAM:8gb
CPU:Xeon e5-2620 @2.0Ghz
OS : windows 10
Please suggest me some Way outs
Thanks