Is there any way to center text with jsPDF?
问题 I'm trying to create a simple pdf doc using javascript. I found jsPDF but I don't figure out how to center text. Is it possible? 回答1: Yes it's possible. You could write a jsPDF plugin method to use. One quick example is this: (function(API){ API.myText = function(txt, options, x, y) { options = options ||{}; /* Use the options align property to specify desired text alignment * Param x will be ignored if desired text alignment is 'center'. * Usage of options can easily extend the function to