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

Transparent PNGs in docx to PDF conversion #472

Open
esglobal opened this issue Jul 7, 2022 · 11 comments
Open

Transparent PNGs in docx to PDF conversion #472

esglobal opened this issue Jul 7, 2022 · 11 comments
Labels
bug Something isn't working help wanted Extra attention is needed libreoffice maybe

Comments

@esglobal
Copy link

esglobal commented Jul 7, 2022

I tried everything I could but I can't find a way to convert a docx file that has a transparent PNG and keep the transparency.

So the docx has a yellow background and I have a transparent PNG top right. The docx file looks good but the converted PDF has white background around the PNG.

Has anyone had this issue? Couldn't find anything in the docs.

@gulien gulien added bug Something isn't working help wanted Extra attention is needed libreoffice maybe labels Jul 7, 2022
@gulien
Copy link
Collaborator

gulien commented Jul 7, 2022

Hello @esglobal!

It might be a limitation of LibreOffice 🤔 I found no options or else for forcing the transparency.

@esglobal
Copy link
Author

esglobal commented Jul 7, 2022

The thing is when I do on a separate machine, a standard manual conversion with libreoffice works like a charm.

@gulien
Copy link
Collaborator

gulien commented Jul 7, 2022

Interesting, what's the LibreOffice version?

@esglobal
Copy link
Author

esglobal commented Jul 7, 2022

LibreOffice 6.4.7.2 and unoconv 0.7 on both machines

@gulien
Copy link
Collaborator

gulien commented Jul 7, 2022

You mean that Gotenberg also uses LibreOffice 6.4?

@esglobal
Copy link
Author

esglobal commented Jul 7, 2022

Nah sorry the docker host has LibreOffice 6.4 my bad

@gulien
Copy link
Collaborator

gulien commented Jul 7, 2022

Gotenberg relies on LibreOffice 7.x, so it could be the culprit 🤔

@esglobal
Copy link
Author

esglobal commented Jul 7, 2022

I'll try update LibreOffice to 7.x and run the same conversion. I don't believe the could've dropped support for transparency, but maybe there are some new parameters.

@gulien
Copy link
Collaborator

gulien commented Jul 7, 2022

Yep or a bug, it happens 🤷‍♂️

@esglobal
Copy link
Author

esglobal commented Jul 8, 2022

Hi @gulien so I used the standard libreoffice --headless --convert-to pdf:writer_pdf_Export test.docx to convert on both versions and LibreOffice 6 preserves PNG transparency, while LibreOffice 7 doesn't.

I'll keep digging and if I will find something useful I'll post it here. Thanks for looking into it

@esglobal
Copy link
Author

esglobal commented Jul 8, 2022

I can confirm 100% that Gotenberg v6 works like a charm, while v7 has issues with PNG transparency in docx documents.

I'll stick to v6 until v7 bug will be fixed. If it'll be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed libreoffice maybe
Projects
None yet
Development

No branches or pull requests

2 participants