Guest User

Untitled

a guest
Nov 12th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5.  
  6. PdfReader reader = new PdfReader(@"c:temptextoPDF.pdf");
  7. int intPageNum = reader.NumberOfPages;
  8. string[] words;
  9. string line;
  10. string text;
  11.  
  12. for (int i = 1; i <= intPageNum; i++)
  13. {
  14. text = PdfTextExtractor.GetTextFromPage(reader, i, new LocationTextExtractionStrategy());
  15.  
  16. words = text.Split('n');
  17.  
  18. for (int j = 0, len = words.Length; j < len; j++)
  19. {
  20. line = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(words[j]));
  21. File.WriteAllText(@"c:temp", line);
  22. }
  23.  
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment