Skip to content

Instantly share code, notes, and snippets.

View crockwave's full-sized avatar

Curtis crockwave

View GitHub Profile
@crockwave
crockwave / pdf.html
Last active April 8, 2022 23:51
PDF rendering using pdf.js 2.13.216 build. Render base canvas, text layer, and annotation layer. Text layer selectable by setting `z-index: 1` in CSS. Includes annotation via pdf-lib.js 1.17.1 and re-rendering on each annotation event.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale = 1.0, maximum-scale = 1.0, user-scalable=no">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@2.13.216/build/pdf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@2.13.216/build/pdf.worker.js"></script>
<script src="https://unpkg.com/pdf-lib@1.17.1"></script>
<script src="https://unpkg.com/downloadjs@1.4.7"></script>