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 trying to retrieve the font encoding for text elements using WebViewer’s JavaScript API. The method getEncoding() is part of the font object in Apryse SDK, which should return a promise resolving the encoding of the font. If the promise isn’t resolving, there might be an issue with how the font object is being retrieved or how the promise is handled.
Some things you can try:
Ensure that the font object is correctly retrieved from the graphics state. Verify that gState.getFont() is returning a valid font object.
Check if the font being used actually has an encoding. Some fonts might not have explicit encoding information available.
Review your implementation to ensure that await is correctly used in an async function, and that there are no errors being silently ignored.
Consider using console.log or breakpoints to debug and check the value of gState and the result of gState.getFont() before calling getEncoding().