Loading Fields Data from PDF
Our sample projects and report templates can help you learn the basics of working with our products.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
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");
}