Thomas Ganyuk
unread,Dec 26, 2017, 1:36:02 PM12/26/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PDFTron WebViewer
Hello Everyone,
I am trying to add a tool which will place text fields onto the document which can be later filled in by different users. This is my code and it draws a shape but I need it to turn into a fillable field (input box):
var FieldAnnotation = function() {
Annotations.MarkupAnnotation.call(this);
this.Subject = 'Field';
};
FieldAnnotation.prototype = $.extend(new Annotations.TextWidgetAnnotation(new Annotations.Forms.Field('newwww')), {
elementName: 'newEleName',
DateCreated: new Date(),
draw: function(ctx){
ctx.translate(this.X, this.Y);
ctx.beginPath();
ctx.lineTo(this.Width, 0);
ctx.lineTo(this.Width, this.Height);
ctx.lineTo(0, this.Height);
ctx.lineTo(0, 0);
ctx.closePath();
ctx.stroke();
}
});
A link to a sample would be great :)
Thanks!