{"id":18251638,"url":"https://github.com/32teeth/canvas-signature","last_synced_at":"2025-04-08T20:46:30.870Z","repository":{"id":57193774,"uuid":"30723002","full_name":"32teeth/canvas-signature","owner":"32teeth","description":"canvas-signature is a canvas based signature capture tool","archived":false,"fork":false,"pushed_at":"2015-03-26T12:53:23.000Z","size":248,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T12:52:34.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Processing","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/32teeth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-12T20:46:01.000Z","updated_at":"2018-03-27T17:28:55.000Z","dependencies_parsed_at":"2022-09-15T22:30:13.720Z","dependency_job_id":null,"html_url":"https://github.com/32teeth/canvas-signature","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/32teeth%2Fcanvas-signature","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/32teeth%2Fcanvas-signature/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/32teeth%2Fcanvas-signature/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/32teeth%2Fcanvas-signature/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/32teeth","download_url":"https://codeload.github.com/32teeth/canvas-signature/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247926926,"owners_count":21019503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:48:07.096Z","updated_at":"2025-04-08T20:46:30.842Z","avatar_url":"https://github.com/32teeth.png","language":"Processing","funding_links":[],"categories":[],"sub_categories":[],"readme":"# canvas-signature\n-----------\n##introduction\n**canvas-signature** is a canvas based signature capture tool to be used when you need users digital signature on forms. examples would be bank account opening authorization.\n\n### design pattern\n**canvas-signature** is built in C++ using the [processingjs](https://processing.org/) library for canvas\n\n### setup\n**canvas-signature** requires an arbitraty html element container encapsulating a canvas element .\n\nthe canvas element and it's parent require id attributes and can be renamed appropriately as long as they are mapped in the signature.pde file as well\n\n*example:*\n\u003cpre\u003e\n\u0026lt;div id=\"signature_container\"\u0026gt;\n\t\u0026lt;canvas data-processing-sources=\"signature.pde\" id=\"signature\"\u0026gt;\u0026lt;/canvas\u0026gt;\n\u0026lt;/div\u0026gt;\n\u0026lt;script src=\"//cdnjs.cloudflare.com/ajax/libs/processing.js/1.4.8/processing.min.js\"\u0026gt;\u0026lt;/script\u0026gt;\n\u003c/pre\u003e\n\nthe **data-processing-sources** attribute of the canvas element is the location of the signature.pde. if you shoved it somewhere else in your directory, map it accordingly.\n\n\nadditionally, you must include the [processingjs](https://processing.org/) library itself. here we use the CDN version from [cdnjs](https://cdnjs.com/)\n\n### signature.pde\nthis is the core 'sketch' that runs the signature canvas app.\nit creates the buttons, image src you need.\n\nadditionally, you can set the callback property to true and the callback_function which is invoked after the user clicks save. the example html file simply has a callback that opens a new window with the signature image.. ..to do with as you please.\n\nall parameters are documented for their intended use, customize as you wish.\n\n\u003cpre\u003e\n/*\n** @param w {int} \n** @description width of desired signature capture canvas\n*/\nint w = 720;\n\n/*\n** @param h {int} \n** @description height of desired signature capture canvas\n*/\nint h = 240;\n\n/*\n** @param canvas_id {string} \n** @description id of canvas element, default is 'signature'\n*/\nString canvas_id = 'signature';\n\n/*\n** @param container_id {string} \n** @description id of div element, default is 'signature_container'\n*/\nString container_id = 'signature_container';\n\n/*\n** @param image_id {string} \n** @description id of output image id, created in this class, can be exported later\n*/\nString image_id = 'signature_iamge';\n\n/*\n** @param redo_text {string} \n** @description string text for the redo button\n*/\nString redo_text = 'redo';\n\n/*\n** @param save_text {string} \n** @description string text for the save button\n*/\nString save_text = 'save';\n\n/*\n** @param helper_text_size {int} \n** @description size of font for helper text\n*/\nint helper_text_size = 14;\n\n/*\n** @param helper_text {string} \n** @description string text for the helper instruction text\n*/\nString helper_text = 'sign here';\n\n/*\n** @param helper_text_color {int} \n** @description grayscale interger for helper text font color (0-255)\n*/\nString helper_text_color = 203;\n\n/*\n** @param signature_color {int} \n** @description grayscale interger for signature pen color (0-255)\n*/\nString signature_color = 102;\n\n/*\n** @param signature_stroke {int} \n** @description size (weight) of pen stroke\n*/\nString signature_stroke = 3;\n\n/*\n** @param tap {boolean} \n** @description if the user has tapped, hide helper text\n*/\nBoolean tap = false;\n\n/*\n** @param callback {boolean} \n** @description if there is a callback function to invoke after save\n*/\nBoolean callback = true;\n\n/*\n** @param callback_function {string} \n** @description string text the callback function to invoke if callback is true\n*/\nString callback_function = 'savedSignature';\n\u003c/pre\u003e\n\nmake sure you check out the [example page](index.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F32teeth%2Fcanvas-signature","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F32teeth%2Fcanvas-signature","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F32teeth%2Fcanvas-signature/lists"}