Parsing Forms Submission Results with Spring Boot
Our sample projects and report templates can help you learn the basics of working with our products.A completed PDF form can be received in a Spring Boot controller and its submitted fields read with the Forms API.
Parse the submission and read fields.
How it works. The submission is parsed once into a typed accessor, so every field and table cell of the returned form is available server-side.
Parse the submission and read fields.
StiPdfFormSubmission submission = new StiPdfFormSubmission();
submission.parseXFDF(data); // data = raw request bytes
String name = submission.getStringValue("CustomerName");
String email = submission.getStringValue("CustomerEmail");
Date date = submission.getDateTimeBoxValue("OrderDate", "MM/dd/yyyy");
String ship = submission.getSingleSelectionValue("DeliveryMethod");Read table rows.int rows = submission.getTableRowsCount("OrderItems");
int cols = submission.getTableColumnsCount("OrderItems");
for (int y = 0; y < rows; y++)
for (int x = 0; x < cols; x++)
System.out.print(submission.getTableFieldValue("OrderItems", x, y) + "|");StiPdfFormSubmission.parseXFDF(bytes)— parse the submitted form data (XFDF) posted to the controller.getStringValue/getDateTimeBoxValue/getSingleSelectionValue— read individual fields;getTableFieldValuereads table cells.
How it works. The submission is parsed once into a typed accessor, so every field and table cell of the returned form is available server-side.