Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- PdfReader reader = new PdfReader(@"c:temptextoPDF.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);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment