String tempFolderPath = Path.GetTempPath(); StreamWriter writeTextFile = File.CreateText(tempFolderPath + "content.txt"); writeTextFile.WriteLine(TransformPdfToText(tempFolderPath + "coalmar100604.pdf")); writeTextFile.Close(); private static string TransformPdfToText(string SourceFile) { string content = ""; PDDocument doc = PDDocument.load(SourceFile); PDFTextStripper stripper = new PDFTextStripper(); try { content = stripper.getText(doc); doc.close(); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { doc.close(); } return content; }
Shruti Gargate wrote:writeTextFile.WriteLine(TransformPdfToText(tempFolderPath + "coalmar100604.pdf"));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)