Converting a PDF to Excel

Converting a PDF to Excel using’s PDF to Excel SDK.

PDF Sharp and other SDKs had the ability to read text from a PDF; however, I had found that InvestInTech’s PDF to Excel kept data in grid form.
This made it easier to use OLEDB to query the excel and strip the data as needed. I had tried InvestInTech’s XML conversion, but it did not have the same clean results.

Here is a sample of how I had accomplished the conversion.

String name = Path.GetFileNameWithoutExtension(filename);
String directory = @"C:temp";

String[] files = Directory.GetFiles(directory);

Int32 iCount = 0;
foreach (String file in files)
toolStripStatusLabel2.Text = " - Converting PDF to Excel File# " + iCount + " of " + files.Count();

CPDF2ExcelClass pdf2Excel = new CPDF2ExcelClass();
IPDF2Excel iPDF2Excel = pdf2Excel;

iPDF2Excel.PDF2Excel(file, file.Replace(".pdf", ".xls"));

toolStripStatusLabel2.Text = " - Converting PDF to Tiff File# " + iCount + " of " + files.Count();

Posted in C#, Excel, PDF

Leave a Reply

Your email address will not be published. Required fields are marked *