The process cannot access the file because it is used by another process.
If the image is open I get the above error.
Here is my code:
PdfContentEditor pdfContentEditor = new PdfContentEditor(pdfDocument);
pdfContentEditor.ReplaceImage(1, 1, AppSettings.GetValue(AppSettings.img) + @"\img.jpg");
using (MemoryStream ms = new MemoryStream())
{
pdfContentEditor.Save(ms);
result = ms.ToArray();
}
I try to add pdfContentEditor.Close, but it didn’t help.
I need a solution for production
I would appreciate your help