I was able to get your above example working with gem version:
wicked_pdf (1.0.6)
Modifying the include tags to reference the latest Jquery CDN, also the Jquery signature library made available in the vendor/assets
directory.
Please see below for the working code:
<%= wicked_pdf_javascript_include_tag "https://code.jquery.com/jquery-3.1.1.min.js" %>
<%= wicked_pdf_javascript_include_tag "jquery.signaturepad.min" %>
<script type="text/javascript">
$(document).ready(function(){
var signature = $('#signature').val();
if (typeof(signature) != 'undefined' && signature != null && signature != "")
{
$('.sigPad').signaturePad({displayOnly:true}).regenerate(signature);
}
});
</script>
<body>
<%= hidden_field_tag("signature", @customer.signature, :id => "signature") %>
<div class="sigPad signed">
<canvas class="pad" width="400" height="140"></canvas>
</div>
</body>
The Jquery signature library was also included in the assets precompile listing to be made available as an individual asset:
config/initializers/assets.rb
Rails.application.config.assets.precompile += ['jquery.signaturepad.min.js']