Add the resulting assembly as reference in your projects, and this line on code:
using VAR.PdfTools;
Then extract the contents of a data column using:
var columnData = new List<string>();
PdfDocument doc = PdfDocument.Load("document.pdf");
foreach (PdfDocumentPage page in doc.Pages)
{
PdfTextExtractor extractor = new PdfTextExtractor(page);
columnData.AddRange(extractor.GetColumnAsStrings("Column"));
}
Or the content of a field (text on the right of the indicated text):
var fieldData = new List<string>();
PdfDocument doc = PdfDocument.Load("document.pdf");
foreach (PdfDocumentPage page in doc.Pages)
{
PdfTextExtractor extractor = new PdfTextExtractor(page);
fieldData.Add(extractor.GetFieldAsString(txtFieldName.Text));
}
It is a simple Windows.Forms application, to test basic funcitionallity of the library.
A Visual Studio solution is provided. Simply, click build on the IDE.
The build generates a DLL and a Nuget package.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
- Valeriano Alfonso Rodriguez.