Hi,
I am trying to update/re-load the document from the server when I click on sync button. Onclick the document to reflect changes made on other devices too.
Currently I am able to see changes when I reopen pdftron i.e. document is “re-loaded” from props.
I tried using this.forceUpdate(); but it didn’t reload the document from the URL.
Is there an api [such as docViewer.loadDocument(); in webviewer] that I can use to reload the document from URL in react-native? Any other alternative you can suggest?
Here’s my code snippet
return (
<View style={{ flex: 1 }}>
<DocumentView
document={filepath} //URL
/>
<View style={styles.button}>
<Button
onPress={() => {
// Updates document changes in server
this.saveAnnotations();
this.forceUpdate(); ---> Doesnot reload the document
}}
title="Sync"
/>
</View>
</View>
);
Thanks.