Beispiel #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);
        }
Beispiel #2
0
        public LocateService(IOptions <LocateConfiguration> configuration)
        {
            _configuration = configuration.Value;

            _client = new HttpClient
            {
                BaseAddress = new Uri(_configuration.Url)
            };

            if (string.IsNullOrEmpty(_configuration.Token))
            {
                throw new Exception(nameof(_configuration.Token));
            }

            if (string.IsNullOrEmpty(_configuration.Url))
            {
                throw new Exception(nameof(_configuration.Url));
            }
        }
        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);
        }