docusealco / docuseal

Open source DocuSign alternative. Create, fill, and sign digital documents ✍️
https://www.docuseal.co
GNU Affero General Public License v3.0
5.55k stars 369 forks source link

Document Template preview changes font colour to black when using Open Sans bold #298

Closed tyler-wright closed 1 week ago

tyler-wright commented 2 weeks ago

I always come across the strangest bugs, I swear!

When using PDF's made with LibreOffice, and using bold, Open Sans font, it automatically changes the font colour to black for some reason.

It does not seem to do this using derivatives of Open Sans, such as 'Semibold', I am not sure why it just picks on Open Sans Bold - very obscure issue I know, but it points to something wrong with whatever code is generating the picture-based previews.

For instance, here's a PDF before it goes into docuseal:

Screenshot from 2024-06-19 21-43-59

Then here's the preview generated in docuseal:

Screenshot from 2024-06-19 21-43-38

It's a really quirky bug, not sure what causes it yet, but wanted to report it here in case I don't get the time to look for what causes it later.

tyler-wright commented 2 weeks ago

If I had to guess, the issue may come from the Vips library (https://github.com/libvips/libvips).

This might be the offending line of code which can be tested to see if its the problem: https://github.com/docusealco/docuseal/blob/781ccc701d6ceefa30591b2547026678e067d0f2/lib/templates/process_document.rb#L31

Other than that I won't look into it further at the moment. I haven't got a ruby dev environment setup at the moment and I so loathe setting them up :sob:

omohokcoj commented 2 weeks ago

@tyler-wright can you please share the original PDF with the issue?

tyler-wright commented 2 weeks ago

That PDF has some other stuff I can't share, but here's one that has the issue all the same:

test.pdf

Here's it in Docuseal:

image

omohokcoj commented 2 weeks ago

@tyler-wright thanks for sharing the PDF. it has been fixed in the Cloud - a new docker version with the fix will be released on Monday