How to change line color in jspdf?

Yevhenii Bahmutskyi

How to change the color of line, produced by using line(x1, y1, x2, y2) method?

Yevhenii Bahmutskyi

Looks like it is possible to accomplish this using setDrawColor() function.

var doc = new jsPDF();
doc.setDrawColor(255, 0, 0);
doc.line(35, 30, 100, 30);

doc.save('line.pdf'); 

JSFiddle

UPD: if you add new page to document, you need to run setDrawColor() function again. Otherwise the color on the new page will be default black.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to change line color in EditText

How to change the color of the line dynamically?

How to change the line color of a UIDatePicker

PlotlyDash: How to change line color?

Altair: How to Change Color of Line in Line Chart?

How to change color of a TextView line by line?

How to set a line width in jsPDF?

How to change the color of a line plot in the plane?

How to change laravel output color on the command line?

How change color of dotted line in mxgraph

How to change the color of the bottom line underneath a SearchView

How to change color of line of an arrow in bokeh?

How to change the line color in seaborn lmplot

how to change color of the selected line in sql developer

How to change color of border line in TextFormField with Flutter

How to change the background color of current line in PhpStorm?

How to change color of Android ListView separator line?

How to change the color of a line using the div id

Octave : How to change line color and width in drawRect

How to change the color of a single line on mousePress()

How to change the color of one datapoint of line graph

How do I change the line color of the tensorboard?

How to change chart series line color in Dojo?

How to change the line color in a plot using geoplot?

How to use command line to change brightness and color?

how to change the color of a line after it was plotted

How to change the background color for exactly one line?

How to change the color of an animated line in matplotlib?

How to change the text color of the cell on condition in autoTable jspdf in Angular2+