Initially save the annotations as a json file. Later you can render Pdf with FPDI (PHP class file). while rendering pdf with fpdi, you can extract json and add those annotations to your pdf
(function () {
function handleSaveClick(e) {
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "Your posturl", true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("savedata="+localStorage.getItem(RENDER_OPTIONS.documentId + '/annotations'));
}
document.querySelector('.savebutton').addEventListener('click', handleSaveClick);
})();
Initially save the annotations as a json file. Later you can render Pdf with FPDI (PHP class file). while rendering pdf with fpdi, you can extract json and add those annotations to your pdf
(function () { function handleSaveClick(e) { var xhttp = new XMLHttpRequest();
xhttp.open("POST", "Your posturl", true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send("savedata="+localStorage.getItem(RENDER_OPTIONS.documentId + '/annotations')); } document.querySelector('.savebutton').addEventListener('click', handleSaveClick); })();