Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print HTML - font-size is ignored #534

Closed
hatsantos opened this issue Feb 2, 2021 · 9 comments
Closed

Print HTML - font-size is ignored #534

hatsantos opened this issue Feb 2, 2021 · 9 comments

Comments

@hatsantos
Copy link

Hello, I found this lib and is really a life safer. Thank you for the work you have done so far.

I just found an issue, regarding the font size.
I'm trying to print and HTML element, and that element has different font sizes in some elements, but in the print job the font seems to be always the same size. I noticed in the docs a prop that allows to change the default font-size "font_size" but this affects all the sizes...

I created a sample project: https://codesandbox.io/s/printjs-fontsize-vkm85

How can I keep print with different font sizes?

Btw, does the CDN URL have the latest version of this lib?
While testing I tried the CDN and found some bugs (not rendering position: absolute).

@jnysteen
Copy link

jnysteen commented Feb 5, 2021

I was just about to report the same issue in this otherwise terrific library..

@jnysteen
Copy link

jnysteen commented Feb 5, 2021

I guess that this might fix it? #524

@crabbly
Copy link
Owner

crabbly commented Feb 18, 2021

Hey guys, this is a known issue and it's going to be fixed in v2. The reason we can't apply this change right now, is for backwards compatibility, since a lot of people could be relying on the current font rule / overwrite.

@jnysteen That MR will fix it, but again, we need to merge that into a v2 branch. I'll close this ticket for now but will leave the MR open until we can merge into v2. Hopefully sooner than later. Thank you!

@crabbly crabbly closed this as completed Feb 18, 2021
@neilroy1998
Copy link

neilroy1998 commented Aug 23, 2021

Hi @crabbly ,

Is there a workaround for setting font-size to certain p/span/... ? I set font-size in css (external and inline); they were not detected.
This is a wonderful library but not able to detect font-size is an issue.

And also, when will v2 come out?

@khosiDigital
Copy link

Hi @crabbly ,

Is there a workaround for setting font-size to certain p/span/... ? I set font-size in css (external and inline); they were not detected. This is a wonderful library but not able to detect font-size is an issue.

And also, when will v2 come out?

Hi Guys, I have also found this great library but really can't use it because the font sizes are ignored.

Let us know what we can do.

Thanks.

@mfarukkoc
Copy link

Hi guys,

I might found a workaround for the problem,

Set an invalid value to the font_size property in config as below and inline styles are ignored.
font_size: ""

@lightnate
Copy link

Hi guys,

I might found a workaround for the problem,

Set an invalid value to the font_size property in config as below and inline styles are ignored. font_size: ""

Thanks, it works!

@zyd100
Copy link

zyd100 commented Jul 27, 2022

Hi guys,

I might found a workaround for the problem,

Set an invalid value to the font_size property in config as below and inline styles are ignored. font_size: ""

thanks a lot

@Zaojixuanji
Copy link

Hi guys,

I might found a workaround for the problem,

Set an invalid value to the font_size property in config as below and inline styles are ignored. font_size: ""

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants