frappe / print_designer

Visual print designer for Frappe / ERPNext
GNU Affero General Public License v3.0
179 stars 101 forks source link

preview does not work correctly with a text editor type field #79

Open 2old4thisShit opened 7 months ago

2old4thisShit commented 7 months ago

When using a text editor field in the print designer, features such as changing the font do not work in the designer preview.

The change really works, but the preview does not show the change.

It seems to work correctly when you generate the pdf or print view. There the changes are displayed correctly.

Original: image

Original with alegreya font (no changes in view): image

From print dialog (seems to be working): image

PDF View: image

bench version: erpnext 15.0.0 frappe 15.0.1 payments 0.0.1 print_designer 1.0.0 webshop 0.0.1

wkhtmltopdf --version wkhtmltopdf 0.12.6.1 (with patched qt)

maharshivpatel commented 7 months ago

Can you check your network tab is there any error loading fonts. they are loaded from google fonts.

Is this PDF rendered on server or client i mean did you use download pdf button and downloaded the pdf or just pressed CMD/CTRL + P and used browsers printing.

2old4thisShit commented 7 months ago

Network tab: image

I have used the buttons.

I only have the problem live, in the designer view.

Elsewhere, including here, it works perfectly: image

maharshivpatel commented 7 months ago

@2old4thisShit can you search fonts in network tab !

2old4thisShit commented 7 months ago

this? image

I made several font changes to test

maharshivpatel commented 7 months ago

@2old4thisShit yeah, i just need to add !important for live preview if field is text editor. would you like to make a PR ? i can help you if you are interested else i will fix this in coming week

2old4thisShit commented 7 months ago

Whatever you need :) tell me

maharshivpatel commented 7 months ago

by the way, this shouldn't have worked we can't just update the font because text we get is already formatted from the editor. it is a bug that changing the font works 😂 . we will try to add this if it always works

2old4thisShit commented 7 months ago

Instead of a bug I have discovered a feature 😅🤣. Cool. The truth is that I was not sure if it was working correctly. So I tried my luck.

Actually with the text editor you can't change the font (I haven't tried it through code). It could be interesting to be able to do it from the print designer. Precisely because of the ease that the print designer adds by not having to use code.

Even if it's just the font... 🤷‍♂️, really dont know... xD