I am developing a C# application in which I am converting a PDF document to an image and then rendering that image in a custom viewer.
I\'ve come across a bit of a bric
Use ITextSharp download it here. Make sure the PDF is searchable.
and use this code:
public static string GetTextFromAllPages(String pdfPath)
{
PdfReader reader = new PdfReader(pdfPath);
StringWriter output = new StringWriter();
for (int i = 1; i <= reader.NumberOfPages; i++)
output.WriteLine(PdfTextExtractor.GetTextFromPage(reader, i, new SimpleTextExtractionStrategy()));
return output.ToString();
}