Do you have an issue with a specific file(s)?
Can you reproduce using one of our samples or online demos?
Are you using the WebViewer server?
Does the issue only happen on certain browsers?
Is your issue related to a front-end framework?
Is your issue related to annotations?
Please give a brief summary of your issue: Word Editor getTemplateKeys Error
(Think of this as an email subject)
Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)
In the process of declaring a variable in the word editor and extracting it, if the text style in the variable is different, an error is returned as shown in the attached. Do I have to match the style? The same appears in the loop statement.
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 you’re encountering an issue with the getTemplateKeys function in the Word Editor of Apryse’s WebViewer, particularly when there’s a style mismatch in the variable text. This suggests that the function may be sensitive to text styling when extracting template keys.
Some things you can try:
Ensure that the text style of the variables you are trying to extract is consistent throughout your document. This might involve standardizing font type, size, and other styling attributes.
Check if the issue is reproducible with different documents or templates, which can help identify if it’s specific to certain styles or documents.
Try using the latest version of the WebViewer, as newer versions may offer improved handling of such issues.
Consider isolating the problem by creating a minimal example document with just the styled text and see if the issue persists.
Thank you for providing all the needed informations.
After a few tests, I can confirm the issue when trying to use the office template fill feature while in the Office Editor. This feature is meant to be used when opening the office file as a PDF using the PDF viewer, not the Office Editor.
As you can see on the Showcase:
We are using the PDF Viewer for this feature.
I was also able to find some issues with your template file. Those issues were generated after loading the file and using this sample code, which is working on our two sample templates: letter_template.docx.pdf (31.2 KB) tg_demo_columns_reflow.docx (14.0 KB)
let doc = documentViewer.getDocument();
const schemaKey = await doc.getTemplateKeys('schema');
{
"docId": 8,
"message": "Template error: Inconsistency in text style of tag:\n\t{{loop test}}{{a}}\n\t ^~~~",
"type": "error"
}
{
"docId": 8,
"message": "Template error: Unmatched tag right-delimiter:\n\ttest}}{{a}}\n\t ^~",
"type": "error"
}
The template does not respect all the conditions. I invite you to read this guide:
think the reason why this error occurred was because the text style in that tag did not match when using {{loop test}} {{a}} {{endloop}} in the word file. In fact, I intentionally put a bind style in the test text.