Skip to content

Recs for JS libraries to let web users select their own signature field's area? #299

Closed Answered by IohannesArnold
IohannesArnold asked this question in Q&A
Discussion options

You must be logged in to vote

So I ended up rolling my own solution with Mozilla's pdf.js. Both the code quality and the user experience of this is pretty poor, but it gets the job done. I'm including it below if anyone else wants to use this to get started:

<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.9.179/pdf.js"></script>
<script>
  pdfjsLib.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.9.179/pdf.worker.min.js";

  let canvasElement = null;
  let canvasScale = 1;

  let selectionCoords = {beginning: null, end: null};
  const inputElement = document.getElementById("upload-unsigned-file-input")


  function resetCoords() {
    selectionCoords.beginning = null;
    s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MatthiasValvekens
Comment options

Answer selected by MatthiasValvekens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants