javascript - jsPDF dotted line (setLineCap) -
i have question jspdf use generate pdf files.
there 1 thing blocked on, it's creation of lines. can using line function, works, apply style on lines, particularly make dotted line.
looking in api, found setlinecap(style) function looks 1 looking for, nothing applied on lines.
so in code have :
doc.setlinecap("round"); doc.line(20, rowposition+4, linewidth, rowposition+4);
the line appears right, line.
does know how make works ?
for additional informations, here api code :
/** object providing mapping human-readable integer flag values designating varieties of line cap , join styles. @returns {object} @fieldof jspdf# @name capjoinstyles */ api.capjoinstyles = { 0: 0, 'butt': 0, 'but': 0, 'bevel': 0, 1: 1, 'round': 1, 'rounded': 1, 'circle': 1, 2: 2, 'projecting': 2, 'project': 2, 'square': 2, 'milter': 2 }; /** sets line cap styles see {jspdf.capjoinstyles} variants @param {string|number} style string or number identifying type of line cap @function @returns {jspdf} @methodof jspdf# @name setlinecap */ api.setlinecap = function (style) { var id = this.capjoinstyles[style]; if (id === undefined) { throw new error("line cap style of '" + style + "' not recognized. see or extend .capjoinstyles property valid styles"); } linecapid = id; out(id.tostring(10) + ' j'); return this; };
i've tried numbers in parameter of function. still doesn't work. hope able me :)
thank !
Comments
Post a Comment