I need to extract text from pdf files (line by line) but it does not write to me in the text file;
class Program
{
static void Main(string[] args)
{
PdfReader reader = new PdfReader(@"c:\temp\textoPDF.pdf");
int intPageNum = reader.NumberOfPages;
string[] words;
string line;
string text;
for (int i = 1; i <= intPageNum; i++)
{
text = PdfTextExtractor.GetTextFromPage(reader, i, new LocationTextExtractionStrategy());
words = text.Split('\n');
for (int j = 0, len = words.Length; j < len; j++)
{
line = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(words[j]));
File.WriteAllText(@"c:\temp\", line);
}
}
}
}
I get error in File.WriteAllText Unable to find a part of the path 'c: \ temp \'. ' Why does the error come out?