Hi,
we are create sample application for signature in the webviewer HTML5.They are two options to create signature,
1.FreeHand tool(default annotation tool)
2.Custom signature
We are facing some issue related to Custom signature.
my requirement append text(Custom signature) on webviewer canvas,we draw text on the canvas detect a mouse click event to get the X and Y coordinates when a user left clicks on the canvas.but When we click zoom in and out the text(Custom signature) will be change/hide(coordinates points) on the document.
How do I get the the X and Y coordinates?
Can you provide me with sample code to create (and display) custom annotations?
sample code:
canvas = document.getElementById('myCanvas');
context = canvas.getContext('2d');
canvas.addEventListener('click', function (evt) {
var rect = canvas.getBoundingClientRect();
var mousePos = getMousePos(canvas, evt);
x= evt.clientX - rect.left,
y= evt.clientY - rect.top
var fontstyle = "28pt Brush Script MT";
var text = $('#hdtext').val();
var context = canvas.getContext('2d');
context.font = fontstyle;
context.fillStyle = 'black';
context.fillText(text, x, y);
}, false); I'm having trouble on custom signature.please help me ASAP.
please refer source code and image attachement.
https://drive.google.com/folderview?id=0B4452hNq_EqrNTBwZkNoTS1WYVE&usp=sharing Note: Freehand tool is works great.