.Net 18.9.1 is the highest my license will allow. Maybe you can let me know if running the PDF through your environment produces different results for table extraction.
I would attach the sample pdf and results files, but apparently I’m not authorized to upload them. (pdf, txt, and xslx)
Below is the code snippets for extracting the tables and converting from pdf to excel.
public void AsposeExtractTables(string fileName)
{
NCCIReport parsedReport = new NCCIReport();
License license = new License();
license.SetLicense(Properties.Settings.Default.AsposePDFFilePath);
this.PDFDoc = new Document(fileName);
TableAbsorber tableAbsorber = new TableAbsorber();
foreach(Page page in this.PDFDoc.Pages)
{
tableAbsorber.Visit(page);
}
StringBuilder tablesSB = new StringBuilder();
foreach (AbsorbedTable table in tableAbsorber.TableList)
{
foreach (AbsorbedRow row in table.RowList)
{
foreach (AbsorbedCell cell in row.CellList)
{
foreach (TextFragment tf in cell.TextFragments)
{
tablesSB.Append($"\"{tf.Text}\", ");
}
}
tablesSB.AppendLine();
}
}
string result = tablesSB.ToString();
}
public void AsposePDFToExcel(string fileName)
{
NCCIReport parsedReport = new NCCIReport();
License license = new License();
license.SetLicense(Properties.Settings.Default.AsposePDFFilePath);
this.PDFDoc = new Document(fileName);
// Instantiate ExcelSave Option object
ExcelSaveOptions excelsave = new ExcelSaveOptions();
excelsave.MinimizeTheNumberOfWorksheets = true;
// Save the output in XLS format
this.PDFDoc.Save("PDFToXLS_out.xls", excelsave);
}