danomatic / react-pdf-html

Render HTML in react-pdf
MIT License
172 stars 40 forks source link

Font-size rendering issue while style text via ck-editor-5 #88

Open mateenNawaz86 opened 6 months ago

mateenNawaz86 commented 6 months ago

I'm encountering an issue with font sizes not matching between ckeditor-5 and react-pdf-html. When setting font sizes using em units (e.g., fontSize: em(2)) in ckeditor-5, the resulting PDF generated by react-pdf-html displays the text with slightly different font sizes, leading to visual inconsistencies. I expect the font sizes applied in ckeditor-5 to translate accurately to the PDF output rendered by react-pdf-html for consistent visual presentation. I've tried adjusting font sizes and units in both editors without success. Can you please provide guidance on resolving this font size discrepancy or recommend best practices for ensuring consistent font rendering between ckeditor-5 and react-pdf-html?

font-size

treezjoz2 commented 6 months ago

image

Did you set fontSize inside Html style tag? If it's not provided, it'll take 18px by default for font size calculation

danomatic commented 3 months ago

@mateenNawaz86 are you still having an issue with this?