Accept an uploaded PDF in ASP.NET Core, parse it with StiPdfParser, and convert its fields into application data.

Receiving the uploaded PDF. The ASP.NET Core action copies the uploaded document into memory and gives its bytes to StiPdfParser.

Converting the fields. The upload handler in Loading Fields Data from PDF/Controllers/HomeController.cs parses the PDF structure and converts its form data into values the application can display or store:
[HttpPost]
public IActionResult ShowPdfFieldsData(IFormFile pdfFile)
{
    if (pdfFile != null)
        using (var stream = new MemoryStream())
        {
            pdfFile.CopyTo(stream);
            var bytes = stream.ToArray();
            var document = StiPdfParser.Parse(bytes);

            ViewData["pdfData"] = StiPdfImportDocumentHelper.ConvertData(document);
        }

    return View("Index");
}

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.