Aspose.Words.Document doc = new Aspose.Words.Document("E:\\112.doc");
Aspose.Words.Tables.Table TableMain = doc.GetChildNodes(NodeType.Table, true)[0] as Aspose.Words.Tables.Table;//以表格方式读取数据
var table0 = doc.GetChildNodes(NodeType.Table, true)[0] as Aspose.Words.Tables.Table;
//Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook("E:\\122.xls");
//Aspose.Cells.Cells cells = workbook.Worksheets[0].Cells;
//DataTable dataTable1 = cells.ExportDataTable(1, 0, cells.MaxDataRow, cells.MaxColumn);//noneTitle
//DataTable dataTable2 = cells.ExportDataTable(0, 0, cells.MaxDataRow + 1, cells.MaxColumn, true);//showTitle
//gridControl1.DataSource = dataTable1;
//gdZJ.DataSource = dataTable2;
LicenseHelper.ModifyInMemory.ActivateMemoryPatching();
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document("E:\\22.pdf");
TableAbsorber absorber = new TableAbsorber();
//使用吸收器访问首页
absorber.Visit(pdfDocument.Pages[1]);
AbsorbedTable table = absorber.TableList[0];
// 可以访问页面上的第一个表,它们的第一个单元格和文本片段
TextFragment fragment = absorber.TableList[0].RowList[4].CellList[5].TextFragments[1];
TextFragment fragment2 = absorber.TableList[0].RowList[5].CellList[5].TextFragments[1];
ExcelSaveOptions options = new ExcelSaveOptions();
// Save output file
pdfDocument.Save("122.xls", Aspose.Pdf.SaveFormat.Excel);
DocSaveOptions opt = new DocSaveOptions();
//pdfDocument.Save("112.docx", opt);
日常笔记
最新推荐文章于 2021-02-23 11:12:19 发布