This is a concise sample to help get Solid Framework up and running. It has been tested with the Free Developer License for Solid Framework using different versions of Microsoft's Visual Studio.
To extract text we will use the SolidFramework.Converters.PdfToTextConverter.
- Import the trial Developer License:
License.Import(new StreamReader(@"C:\Users\Joe\license.xml"));
- Locate the PDF files to using OpenFileDialog:
OpenFileDialog OpFile = new OpenFileDialog();
//show only PDF Files
OpFile.Filter = "PDF Files (*.pdf)|*.pdf";
if (OpFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
...
- Define strings to manage opening files:
String PdfFullPath = OpFile.FileName;
- Extract the text using PDFtoTextConverter:
using (PdfToTextConverter converter = new PdfToTextConverter())
{
//Add the selected file
converter.AddSourceFile(PdfFullPath);
//Force the file to be overwritten
converter.OverwriteMode = SolidFramework.Plumbing.OverwriteMode.ForceOverwrite;
// Select where to save the file
converter.OutputDirectory = @"C:\Users\nelson\Documents\samples\SF Documents Tutorials";
//Convert the File, Saving it as the same name but with the extension .txt
converter.Convert();
}
...