New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to load saved annotations? #18
Comments
Hey! There was an issue in that functions which made it impossible load JSON at page load. I've always checked that function with AJAX. That's why I haven't found that issue until now. var pdf = new PDFAnnotate('pdf-container', 'pdf.pdf', {
ready() {
pdf.loadFromJSON(<json>)
}
}); |
Is this function on master branch or develop branch? Actually i have removed jQuery completely and converted whole functionality with vanilla Javascript. |
it's on master |
@RavishaHesh Please check the option again,
In above example, I have tried this, My main file
ERROR: docConf is not defined Then,
ERROR: app.js:21113 Uncaught (in promise) TypeError: Cannot read property 'loadFromJSON' of undefined annotatepdf.js file is
Tried to change
Even than its not working. Can you please show a working example that loads json from script.js into pdf on load? |
Actually above error occurs because you have binding the var pdf = new PDFAnnotate("pdf-container", "pdf.pdf", {
onPageUpdated(page, oldData, newData) {
console.log(page, oldData, newData);
},
ready: function () {
console.log(this);
}.bind(this),
}); |
Hope I have answered your issue. Feel free to re-open if you need further clarifications |
Hi,
I saw a loadFromJSON already exists but I tried to use it and it won't work. I am getting configurations from serializePdf function and tried to load it into the loadFromJson before inst.initFabric() call.
I wanted to load prev state of of annotation last added by user, which can be editable and new annotation can be added as permission given to the user.
The text was updated successfully, but these errors were encountered: