Issue
Entity detection does not work when Email Bot processes PDF attachments that contain editable form fields in Pega Customer ServiceTM 24.2.1.
Symptoms and Impact
- Email Bot receives an inbound email with a multi-page PDF attachment containing editable form fields.
- Rule-based Text Annotation (RUTA) scripts are correctly configured in Prediction Studio and detect entities when tested directly with text input.
- No entities are detected when the email and PDF attachment are processed end to end.
- No errors are displayed in the case or recorded in the logs.
- Auto Indexing reports show fewer successful entity-indexing results.
- Missing entity data can affect case creation, routing, indexing, and downstream customer operations.
- This issue applies when editable-form values are appended beyond the default 20,000-character NLP analysis limit. The likelihood increases for longer PDFs, typically documents with eight or more pages depending on content density.
PDFs with editable form fields (AcroForm type) where field values are positioned visually early in the document but extracted by Apache Tika at the end of the text stream.
PDFs large enough that form field data appears beyond the 20,000-character default NLP limit (typically 8+ pages depending on content density).
Any RUTA-based entity extraction model targeting data from editable PDF form fields via Email Bot attachment analysis.
Steps to reproduce
- Configure an Email Bot channel with attachment analysis enabled and a RUTA-based entity extraction model that targets fields such as account number and sort code.
- Send an inbound email with a multi-page PDF attachment of 12 or more pages where the target entity values are in editable form fields on the first or second page.
- Allow Email Bot to process the email and create the case.
- Inspect the NLP analysis results and observe that no entities are detected.
- Retrieve the TaSummaryID from the pyHistory page list under pyWorkPage and filter the Data-NLP-Report-Summary instances to review the extracted text content.
Root Cause
The issue results from the interaction of the PDF text-extraction order and the default Pega NLP analysis limit.
Apache Tika PDF parser field ordering
The pyExtractText activity uses the Apache Tika parser to extract text from PDFs. For PDFs with editable form fields, also known as AcroForms, the parser appends the form-field values at the end of the complete extracted text, after the page content, regardless of where the fields appear visually in the PDF.
This is the standard behavior of the Apache Tika layered text-extraction model. Because the input is base64 encoded, markers cannot be inserted before extraction to identify where the form-field data begins.
Pega NLP character limit
Pega NLP Text Analyzer processes only the first 20,000 characters of extracted text by default. The limit prevents timeout issues in production environments.
In the reported 12-page PDF, the extracted text contained approximately 37,000 characters. The editable-form values, including account numbers and sort codes, were appended after the page content and therefore fell outside the 20,000-character analysis window.
Failure sequence
Email Bot receives the PDF attachment → Apache Tika extracts the complete text and appends the form-field values near the end → Pega NLP analyzes only the first 20,000 characters → the form-field values are excluded → the RUTA model finds no matching entities → no entities are detected and no error is raised.
Solution
This is a known limitation. An enhancement request has been created to improve entity detection for PDFs with editable form fields.
Workaround
Use a selective extraction method, such as extracting terminal characters, to make the required editable-form values available within the text analyzed by Pega NLP.
Increasing the NLP character limit to 50,000 enabled entity detection during testing. However, increasing the limit can increase processing time and introduce timeout risks. Therefore, increasing the limit is not recommended for production environments.
Prevention and planning guidance
When updating platforms or onboarding new PDF form templates for Email Bot entity extraction:
- Profile the extracted-text character length of PDF templates used for attachment-based entity detection.
- For templates that produce more than 20,000 characters, determine whether the required entity values occur within the first 20,000 characters or are appended later as editable-form values.
- Test RUTA scripts in Prediction Studio by using representative extracted-text samples before Go-Live.
- Record the extracted-text character count for each PDF template as a baseline for assessing future changes.
References
NLP Maximum Character Limit - Setting the maximum characters limit