Please give a brief summary of your issue:
Cannot give default styles on annotation tools on React Native
Please describe your issue and provide steps to reproduce it:
We want to assign default styles (background color on text annotation etc) to annotation tools, but it is not supported by default. We are using React Native Expo
Please provide a link to a minimal sample where the issue is reproducible:
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.
When working with annotations in React Native using the Apryse SDK, you can set default styles for annotations by configuring the viewer settings. Unfortunately, setting default styles directly through the @pdftron/react-native-pdf package might not be straightforward as it doesn’t provide this functionality out-of-the-box. However, you can achieve this by programmatically setting styles once an annotation is created.
Some things you can try:
Use the onAnnotationChanged event to detect when an annotation is created and apply your desired styles.
Consider setting default styles through native code if your app uses custom native modules.
Explore using XFDF to pre-define annotation styles and import them once the document is loaded.
Thank you for your response. In order to best assist you, would you be able to thoroughly describe your use-case and what you are trying to achieve? What is your goal exactly, so that we may best advise. I look forward to your response.
Actually when users annotate on pdf, (especially if they use Config.Tools.annotationCreateFreeText), it is overlapping with text on pdf. So we are trying to set default white background if added/modified annotation has transparent background, so users can see added annotation clearly.
Thanks
Thank you for your response. Please note that these customizations would have to be done fully natively. The provided guides should help with the desired customizations. Are there any issues with this working on your end? Any further information provided would be greatly beneficial to my investigation. I look forward to your response.