Exemplo n.º 1
0
        public static RetornoCNAB240 Return(String Path)
        {
            RetornoCNAB240 Return = new RetornoCNAB240();
            Int32          Count  = -1;
            Object         Identity;

            String[] Lines;
            try {
                Lines = (!String.IsNullOrEmpty(Path)
                    ? System.IO.File.ReadAllLines(Path)
                    : throw new Exception("O caminho do arquivo não foi informado ou está incorreto!"));

                foreach (String FoundLine in Lines)
                {
                    Identity = Convert.ToInt32(FoundLine.RetriveOnLine(8, 8));
                    if ((IsFile)Identity == IsFile.HeaderAllotment)
                    {
                        Count++;
                    }
                    ;
                    Return = RetriveLine(FoundLine, Return, Count);
                }
            } catch {
                throw;
            }
            return(Return);
        }
Exemplo n.º 2
0
        public Form5()
        {
            InitializeComponent();

            string connectionString = CM.AppSettings["connectionString"];

            Connection = new IrbisConnection();
            Connection.ParseConnectionString(connectionString);
            Connection.Connect();

            Grid = new SiberianFoundGrid
            {
                Dock = DockStyle.Fill
            };
            Controls.Add(Grid);

            List <FoundLine> lines = new List <FoundLine>();

            for (int i = 1; i < 100; i++)
            {
                try
                {
                    string    description = Connection.FormatRecord("@brief", i);
                    FoundLine line        = new FoundLine
                    {
                        Mfn          = i,
                        Materialized = true,
                        Description  = description
                    };
                    lines.Add(line);
                }
                catch
                {
                    // Nothing to do
                }
            }

            Connection.Dispose();

            Grid.Load(lines.ToArray());

            //FormClosed += _FormClosed;
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            // Create Bytescout.PDFExtractor.LineDetector instance
            LineDetector lineDetector = new LineDetector();

            lineDetector.RegistrationName = "demo";
            lineDetector.RegistrationKey  = "demo";

            // Load sample PDF document
            lineDetector.LoadDocumentFromFile(@".\sample2.pdf");

            FoundLinesCollection foundLines = lineDetector.FindLines(1, LineOrientationsToFind.HorizontalAndVertical);

            Console.WriteLine("Number of lines found: " + foundLines.Count);

            for (int i = 0; i < foundLines.Count; i++)
            {
                FoundLine line = foundLines[i];

                Console.WriteLine("Line # " + i);

                // Line Orientation
                Console.WriteLine("LineOrientation: " + line.LineOrientation);

                // Starting point of the line
                Console.WriteLine("From point: " + line.From);

                // Ending point of the line
                Console.WriteLine("To point: " + line.To);

                // Line width
                Console.WriteLine("Width: " + line.Width);
            }

            Console.ReadLine();
        }