Exemplo n.º 1
0
        private static void pdftronTransfer(string pdfPath, string txtPath)
        {
            pdftron.PDFNet.Initialize("Reuters Technology China Ltd.(thomsonreuters.com):CPU:1::W:AMC(20121010):AD5EE33F2505D1CAF1B425461F9C92BAA89204FA0AD8AAA17E07887EF0FA");
            TableLocator        locator = new TableLocator(pdfPath);
            LocateConfiguration Config  = new LocateConfiguration
            {
                TableEndFirstLetterRegex        = @"\d",
                TableEndRegex                   = @"\d{1,}/\d{1,}",
                TableNameNearbyFirstLetterRegex = "상",
                TableNameNearbyRegex            = "상장일"
            };
            List <TablePos>  tablePosList = locator.GetMultiTablePos(".*?추가상장\\s*내역", Config);
            List <FreeTable> tableList    = tablePosList.Select(tablePos => TableExtractor.Extract(locator.pdfDoc, tablePos)).ToList();

            WriteFreeTableToTxt(txtPath, " ", tableList);
        }
        private static void pdftronTransfer(string pdfPath, string txtPath)
        {
            //pdftron.PDFNet.Initialize("Reuters Technology China Ltd.(thomsonreuters.com):CPU:1::W:AMC(20121010):AD5EE33F2505D1CAF1B425461F9C92BAA89204FA0AD8AAA17E07887EF0FA");
            TableLocator        locator = new TableLocator(pdfPath);
            LocateConfiguration config  = new LocateConfiguration();

            config.TableEndFirstLetterRegex        = @"\d";
            config.TableEndRegex                   = @"\d{1,}/\d{1,}";
            config.TableNameNearbyFirstLetterRegex = "상";
            config.TableNameNearbyRegex            = "상장일";
            List <TablePos>  tablePosList = locator.GetMultiTablePos(".*?추가상장\\s*내역", config);
            List <FreeTable> tableList    = new List <FreeTable>();

            foreach (var tablePos in tablePosList)
            {
                FreeTable table = TableExtractor.Extract(locator.pdfDoc, tablePos);
                tableList.Add(table);
            }
            WriteFreeTableToTxt(txtPath, " ", tableList);
        }