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

libreoffice: use build flags tested with ppt #23733

Closed

Conversation

MthwRobinson
Copy link

#22069 noted that libreoffice cannot convert PowerPoint files. We had the same issue and built libreoffice locally with the build flags in this PR. PowerPoint files convert successfully when building libreoffice with these flags.

Note, while this build works for our purposes (headless file conversion with soffice), I'm unsure if changing the flags would impact functionality other users may need.

Fixes:

Related:

Pre-review Checklist

After building the .apk locally with melange, we did the following to test.

docker run -it --platform linux/amd64 cgr.dev/chainguard/wolfi-base
apk add libreoffice-24-24.2.4.2-r1.apk  --allow-untrusted
ln -s /usr/lib/libreoffice/program/soffice.bin /usr/bin/libreoffice
ln -s /usr/lib/libreoffice/program/soffice.bin /usr/bin/soffice
chmod +x /usr/lib/libreoffice/program/soffice.bin
chmod +x /usr/bin/libreoffice
chmod +x /usr/bin/soffice
5288451bdb34:/app# soffice --headless --convert-to docx --outdir /app fake.doc
convert /app/fake.doc as a Writer document -> /app/fake.docx using filter : MS Word 2007 XML
5288451bdb34:/app# ls
fake-power-point.ppt            fake.docx
fake.doc                        libreoffice-24-24.2.4.2-r1.apk
5288451bdb34:/app# soffice --headless --convert-to pptx --outdir /app fake-power-point.ppt
convert /app/fake-power-point.ppt as a Impress document -> /app/fake-power-point.pptx using filter : Impress Office Open XML
5288451bdb34:/app# ls
fake-power-point.ppt            fake.doc                        libreoffice-24-24.2.4.2-r1.apk
fake-power-point.pptx           fake.docx

@dlorenc
Copy link
Contributor

dlorenc commented Jul 10, 2024

Is there anyway you could provide a sample ppt file you used as a test along with a script you use to convert? You can just upload it here or something. Ideally we'll be able to narrow this down without having to disable all those features.

@MthwRobinson
Copy link
Author

MthwRobinson commented Jul 10, 2024

@csbuild-c7ks7s
Copy link

Hi! Any progress or updates on this PR?

@hughesadam87
Copy link

Is there any consensus if this fix is going in or not? We rely on converting PPT to PDF and are gauging whether we should wait for this to go in, or go in another direction.

Copy link
Member

@EyeCantCU EyeCantCU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this is needed after some testing. This is how I set up a testing environment:

make local-wolfi
apk add libreoffice python-3.11 wget
wget https://github.com/Unstructured-IO/unstructured/raw/main/example-docs/fake-power-point.ppt -O /tmp/test.ppt
cd /tmp

Then I ran the above command:

/tmp# /usr/lib/libreoffice/program/soffice.bin --headless --convert-to pdf test.ppt
convert /tmp/test.ppt as a Impress document -> /tmp/test.pdf using filter : impress_pdf_Export

We can see from the log that it's able to successfully convert the PPT to a PDF. And I can see the created PDF, test.pdf, in the directory

Regardless, I don't believe we should be disabling all of these features. Interested in hearing how others are encountering this so that I can replicate this issue

@MthwRobinson
Copy link
Author

@EyeCantCU - Yeah I believe we can close this out. And I've heard from other users that PPT -> PPTX works with the current libreoffice build. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

5 participants