Пример #1
0
        static void Main(string[] args)
        {
            //string path = Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName, "CV-2.pdf");
            //string[] lines = File.ReadAllLines(path);

            ResumeProcessor resumeProcessor = new ResumeProcessor();

            Resume resume = new Resume();

            FileStream to_strem = new FileStream(Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName, "sample_resume.doc"), FileMode.Open);
            //byte[] bytes = System.IO.File.ReadAllBytes(Path.Combine(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName, "CV-4.pdf"));
            //string[] lines = CVReader.GetContentFromPdf(resume, new MemoryStream(bytes));
            //resume = resumeProcessor.Parse(lines);

            var c = CVReader.GetContentFromPdf(resume, Helpers.Convert.ToPdfStream(to_strem));

            var           index = Array.FindIndex(c, x => x.Contains("Pty Ltd", StringComparison.InvariantCultureIgnoreCase));
            List <string> list  = c.ToList();

            list.RemoveRange(0, index + 1);
            c = list.ToArray();

            //var q = CVReader.GetContentFromPdf(resume, new MemoryStream(bytes));
            resume = resumeProcessor.Parse(c);
            Console.ReadKey();
        }
Пример #2
0
        public byte[] GetPictureFromStream(Stream stream, string contentType)
        {
            if (contentType == "application/pdf")
            {
                return(CVReader.GetPictureFromPdf(stream));
            }

            Stream pdfStream = Convert.ToPdfStream(stream);

            return(CVReader.GetPictureFromPdf(pdfStream));
        }
Пример #3
0
 public string[] GetTextFromStream(Stream stream, string contentType)
 {
     return(contentType == "application/pdf" ? CVReader.GetContentFromPdf(stream) : CVReader.GetContentFromDocAndTxt(stream));
 }