I am using the Pdf.Kit to extract text from a pdf.
I can make the extractor.GetText(outputFile) to work, but I would like to be able to return the text to the screen in a text box.
Can you help please?
Thanks
Rob
private void convertPDF(string inputName, string outputName, int txtMode){
Aspose.Pdf.Kit.License license = new Aspose.Pdf.Kit.License();license.SetLicense(@"C:\Program Files\Aspose\Aspose.Pdf.Kit for .Net\bin\net35\Aspose.Pdf.Kit.lic");
MemoryStream outputTxt = new MemoryStream();PdfExtractor extractor = new PdfExtractor();extractor.BindPdf(inputName);
extractor.ExtractTextMode = txtMode;
extractor.ExtractText();
extractor.GetText(outputName);
extractor.GetText(outputTxt);
StreamReader streamReader = new StreamReader(outputTxt);string result = "";result = streamReader.ToString();
result = result + streamReader.ReadToEnd();
textBox1.Text = result;
streamReader.Close();
outputTxt.Close();
}
This message was posted using Aspose.Live 2 Forum