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

Can't print with style #693

Open
Schangiwalem opened this issue Oct 12, 2023 · 1 comment
Open

Can't print with style #693

Schangiwalem opened this issue Oct 12, 2023 · 1 comment

Comments

@Schangiwalem
Copy link

Hi!

I'm sorry because I'm pretty sure you've already answered to that question many times but even when I check all topics, I can't solve my problem.

I explain :

I'm using Wordpress > Elementor & Formidable (to get the context).

Inside my Formidable view (Html), I put a button to print my nutritional values but I can't embed CSS with it, I tried to use targetStyles: ['*'] but nothing works, everytime my print window is ugly.

This is what I want to print (without the print button)
image

This is what I get :
image

Here the code I inserted : <button type="button" onclick="printJS({ printable: '[50]', type: 'html', targetStyles: ['*']})">Imprimer</button> ([50] is a variable of formidable)

I have correctly imported css and js files inside the head tag :
image

Please, does anyone has a solution for me ? (I can't use external CSS file on my wordpress, all is merged and managed by wordpress).

Thanks a lot!

@semvis123
Copy link

semvis123 commented Oct 15, 2023

Try using type: "raw-html", had some luck with that

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

2 participants