I would like to store last selected values in the text editor dialog. Is this even possible with the current SDK?
I want customers to have the same settings as they set up when last using the dialog. Want to be able to “remember” font size, font style (bold/italic/strikethrough…)…
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 is possible to customize and extend the behavior of the text editor in WebViewer to remember user preferences such as font size and style. However, the SDK does not directly provide a built-in feature to store these settings across sessions. You would need to implement a mechanism to save and retrieve these preferences, possibly using local storage or a database.
Some things you can try:
Use the setTextAttributes API in the Core.ContentEdit namespace to programmatically set font styles when initializing the text editor.
Store user preferences in local storage or a similar persistent storage solution when the user sets their preferences.
On initialization of the text editor, read the stored preferences and apply them using the setTextAttributes API.
That does not work for me as I need to store this for user in their external session information. If they log in on a different machine and use the app it still needs to show them last settings used
Is there any way to get this information out of the dialog when user changes these settings?
I already have save button for storing PDF changes back,
but the selections need to be saved as soon as they change.
But I also think there is a bigger problem here.
At the moment I don’t see text dialog saving any data back to the local storage at all.
It’s always default settings that I set for the FreeTextTool.
I even used setInterval to read data storage 10/second and there are no changes made when
user is interacting with the dialog components. Not even before dialog is disposed.
I already have save button for storing PDF changes back,
but the selections need to be saved as soon as they change.
Unfortunately, we do not have an event that tracks if a user has made changes to the style options. This can be tracked potentially with a visibilityChanged event when the style modal popup is closed: https://sdk.apryse.com/api/web/UI.html#event:visibilityChanged
But I also think there is a bigger problem here.
At the moment I don’t see text dialog saving any data back to the local storage at all.
It’s always default settings that I set for the FreeTextTool.
Are you able to reproduce this on the showcase demo?