Tutorial Membuat PDF Preview mengunakan PDF Worker.js, PDF Option.js, PDF.js
Kali kita membuat preview file pdf ketika akan di upload ke server menggunakan plugin mengunakan PDF Worker.js, PDF Option.js, PDF.js
Tutorial Membuat PDF Preview mengunakan PDF Worker.js, PDF Option.js, PDF.js |
Langsung saja tanpa pikir panjang di source codenya.
Kodenya :
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="pdf-preview/pdf.style.css"> </head> <body> <div id="preview-container"> <button id="upload-dialog">Pilih PDF</button> <input type="file" id="pdf-file" name="pdf" accept="application/pdf" /> <div id="pdf-loader">Loading Preview ..</div> <canvas id="pdf-preview" width="250"></canvas> <span id="pdf-name"></span> <button id="upload-button">Upload</button> <button id="cancel-pdf">Cancel</button> </div> <script src="pdf-preview/pdf.js"></script> <script src="pdf-preview/pdf.worker.js"></script> <script src="pdf-preview/pdf.option.js"></script> </body> </html>
Hasilnya Seperti:
Tutorial Membuat PDF Preview mengunakan PDF Worker.js, PDF Option.js, PDF.js |
Jika masih bingung silahkan download SOURCE CODENYA disini
Server [SF] Server [MF]
Hore.... Done....
Server [SF] Server [MF]
Hore.... Done....