Do you have an issue with a specific file(s)? No
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? No
Is your issue related to annotations? Yes
Hello,
I’m using Apryse WebViewer 11.6 and need assistance solving an issue with duplicate AcroForm fields.
Problem: I have a PDF with fields that share the same name (e.g., “Check Box3” appears twice as separate widgets but associated with the same logical field). This causes conflicts in my application.
Goal: I would like to automatically add an incremental suffix (_1, _2, _3, etc.) to all fields that have the same AcroField name, making them unique.
Event Issue: I’ve noticed that:
The documentLoaded event is triggered before annotations are loaded
The annotationsLoaded event is never triggered in my code:
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
It seems like you’re encountering an issue with duplicate AcroForm field names in a PDF document using Apryse WebViewer. The task is to ensure that fields with the same name are renamed with unique identifiers. This involves handling events correctly and using the appropriate methods to detect and rename these fields.
Some things you can try:
Ensure that your event listener for annotationsLoaded is correctly set up. This event should be triggered once all annotations are fully loaded into memory.
Use the FieldManager to iterate over form fields once the annotations are loaded. This will allow you to identify fields with duplicate names.
Rename the fields by appending an incremental suffix. Ensure that you update both the field name and its associated widget annotations.
Check if the annotationsLoadedPromise resolves correctly to ensure fields are accessible when you attempt to modify them.
Here are some resources that might help you:
Modifying PDF form fields in JavaScript: Learn how to iterate over fields and modify their properties, which is essential for detecting duplicates and renaming them.