Question

JsDoc Reference

It is stated in both source code and documentation that you can draw Bezier Curve with the function .lines. I have included the current version of jspdf.min.js and called the following method

var doc = new jsPDF();
doc.lines([[2,2],[-2,2],[1,1,2,2,3,3],[2,1]], 212,110, 10);
doc.save();

The pdf file is generated, but when I open it, it doesn't have any drawing and gives you the following error message.

An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem.

Is this happening to everyone or am I doing it wrong?

Thank you in advance.

Was it helpful?

Solution

I have no idea what's up with those docs, but it looks like there's an error their scale argument. It's supposed to be a list of two elements, but they're only providing a single number. Try something like this:

doc.lines([[2,2], [-2,2], [1,1,2,2,3,3], [2,1]], 0, 0, [10,10]);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top