I have a pdf template included in an Asp.net Solution as: “\solution\pdf\template.pdf”
How can I use this file in the project (such as do a filestream)?
I have done
using iTextSharp.text.pdf;
…
string pdfTemplate = HttpContext.Current.Server.MapPath("~\\pdf\\template.pdf");
pdfReader = new PdfReader(pdfTemplate);
It gives me error as “Some program is using this file”. I know it is Visual Studio itself. How can I fix this?
Thanks!
Edited:
I thought It would be the path problem. I am using the itextsharp library and I suppose the Pdfreader would generate a file stream to load the file.
Please check ReadStream method, u might not be closing streams.
can u post your ReadStream code here