Open janlord01 opened 2 years ago
Are there any errors in the browser's dev tool console? like JSON parse errors
Are there any errors in the browser's dev tool console? like JSON parse errors
no errors on ready(), but when I console log it, it outputs undefined.
@janlord01 could you please paste your code to better understand your issue?
i'm having an issue while retrieving json data from the storage after parsing it
here's my code:
var data1 = JSON.parse(localStorage.getItem('CanvaData'));
pdf.loadFromJSON(data1)
any solution?
@khaledmndev and can you post your data1 value?
@khaledmndev and can you post your data1 value?
sure, i used console.log(data1) if you that i you wanted:
here's a link for the value stored in a txt file, since the value and size is too big (sorry can't paste it here): https://mega.nz/file/q9ZmxRZb#qJPj3mB8MQzG34UWf53zPRbO960XsdVnRdS9RzluGeY
@khaledmndev and what error message do you get?
@str Uncaught (in promise) SyntaxError: Unexpected end of JSON input at JSON.parse () at i.loadFromJSON (fabric.min.js:1:131008) at i. (pdfannotate.js:286:14) at Function.each (jquery.min.js:2:2976) at PDFAnnotate.loadFromJSON (pdfannotate.js:284:4) at Object.ready (script.js:15:13) at HTMLCanvasElement. (pdfannotate.js:87:13) at Function.each (jquery.min.js:2:2976) at S.fn.init.each (jquery.min.js:2:1454) at PDFAnnotate.initFabric (pdfannotate.js:60:15)
@khaledmndev as you can see, the error says it was not able to parse the JSON value (1.5MB string length). It may be because of the length of the background fields in the canvas. I suggest you to try without the backgrounds
If you still get any errors, I suggest you to open a new issue with that error message.
@str still no luck i've tried with only drawing with pen! i'll open a new issue..
by the way i tried pasting the json value data into pdf.loadFromJSON("here"), and it worked! thanks for helping anyways :)
Tried to load pdf.loadFromJSON(serializedJSON) but its not working. Any help please? Thanks