Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Problem searching and extracting text

$
0
0
I have a document where this example does not work ... //open document Document pdfDocument = new Document("input.pdf"); //create TextAbsorber object to extract text TextAbsorber textAbsorber = new TextAbsorber(); //accept the absorber for all the pages pdfDocument.Pages.Accept(textAbsorber); //get the extracted text string extractedText = textAbsorber.Text; // create a writer and open the file TextWriter tw = new StreamWriter("extracted-text.txt"); // write a line of text to the file tw.WriteLine(extractedText); // close the stream tw.Close(); It crashes on the Accept() function. Please advise.
This message was posted using Banckle Live Chat 2 Forum

Viewing all articles
Browse latest Browse all 3131

Trending Articles