private DateTime GetNegotiationDate(PdfPage page)
        {
            var addressRect = SinacorNotePosition.GetRectangle(SinacorNotePosition.NegotiationDate);
            var ret         = ReaderExtensions.ExtractText(page, addressRect).FirstOrDefault();

            return(DateTime.ParseExact(ret, "dd/MM/yyyy", CultureInfo.InvariantCulture));
        }
        private List <OperationType> ProcessOperationTypeColumn(PdfPage page)
        {
            var addressRect = SinacorNotePosition
                              .GetRectangle(SinacorNotePosition.NegotiationColumnsPosition.OperationTypeColumn);

            var operationTypeCells = ReaderExtensions.ExtractText(page, addressRect).First()
                                     .Split(Environment.NewLine.ToCharArray()).Select(x => x == "C" ? OperationType.Buy : OperationType.Sell);

            return(operationTypeCells.ToList());
        }
        private List <decimal> ProcessStockPriceColumn(PdfPage page)
        {
            var addressRect = SinacorNotePosition
                              .GetRectangle(SinacorNotePosition.NegotiationColumnsPosition.StockPriceColumn);

            var stockAmountCells = ReaderExtensions.ExtractText(page, addressRect)
                                   .First().Split(Environment.NewLine.ToCharArray()).Select(x => decimal.Parse(x));

            return(stockAmountCells.ToList());
        }
        private List <string> ProcessStockNameColumn(PdfPage page)
        {
            var addressRect = SinacorNotePosition
                              .GetRectangle(SinacorNotePosition.NegotiationColumnsPosition.StockNameColumn);

            var ret = ReaderExtensions.ExtractText(page, addressRect)
                      .First().Split(Environment.NewLine.ToCharArray());

            //Removing stock's specifications like ordinárias (ON) ou preferenciais (PN),
            //this usually occurs after two consecultive spaces after stock's name
            var stockNameCells = ret.Select(X => X.Split(new string[] { "  " }, StringSplitOptions.None)[0]).ToList();

            return(stockNameCells);
        }
        private string GetBrokerName(PdfPage page)
        {
            var addressRect = SinacorNotePosition.GetRectangle(SinacorNotePosition.BrokerNameRectangle);

            return(ReaderExtensions.ExtractText(page, addressRect).FirstOrDefault());
        }