Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
C# How to get text from PDF file with iTextSharp
// source is a byte array
using (var reader = new PdfReader(source))
{
using (var output = new StringWriter())
{
for (int i = 1; i <= reader.NumberOfPages; i++)
{
output.WriteLine(PdfTextExtractor.GetTextFromPage(reader, i));
}
return output.ToString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment