crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.28k stars 672 forks source link

class or style font-size is not working #616

Open Carry-Ku opened 2 years ago

Carry-Ku commented 2 years ago

Such as, I use Print.js,I want to get a new font-size, i put it in class or style,It's not working, how

fooooxxxx commented 2 years ago

Try to use an printjs v1.3.1, printjs add font-size: font_size !important on new version.It caused some font-size to be ignored. Or wait for the author to release v2.

4KDA commented 2 years ago

+1

borisdmt commented 2 years ago

set font_size: "" in printjs settings seems to working to be a work around for this

qq919501422 commented 2 years ago

+1

shenjilina commented 2 years ago

set font_size: "" in printjs settings seems to working to be a work around for this

const style = '@page { } ' +'@media print { .f-14{ font-size: 14ppx }' ; printJS({ printable: "printTable", type: "html", header: null, targetStyles: ["*"], style: style, });
I wrote this way, but I still don't work. How did you write it?

tuan6956 commented 2 years ago

set font_size: "" in printjs settings seems to working to be a work around for this

const style = '@page { } ' +'@media print { .f-14{ font-size: 14ppx }' ; printJS({ printable: "printTable", type: "html", header: null, targetStyles: ["*"], style: style, }); I wrote this way, but I still don't work. How did you write it?

u should set font_size: '' same:

printJS({
     printable: "printTable",
     type: "html",
     header: null,
     targetStyles: ["*"],
     style: style,
     font_size: ''
});
499433627 commented 12 months ago

set font_size: "" in printjs settings seems to working to be a work around for this

const style = '@page { } ' +'@media print { .f-14{ font-size: 14ppx }' ; printJS({ printable: "printTable", type: "html", header: null, targetStyles: ["*"], style: style, }); I wrote this way, but I still don't work. How did you write it?

u should set font_size: '' same:

printJS({
     printable: "printTable",
     type: "html",
     header: null,
     targetStyles: ["*"],
     style: style,
     font_size: ''
});

thanks!

qiushuanglin commented 5 months ago

nb