instructure / pdf-annotate.js

Annotation layer for pdf.js (no longer maintained)
http://instructure.github.io/pdf-annotate.js/
MIT License
543 stars 277 forks source link

How to Upload and show pdf file #52

Open ghost opened 6 years ago

loky003 commented 6 years ago

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); })();