I need a way to flatten PDFs, treating them as images. I frequently use LibreOffice Draw, as it is the perfect tool for many tasks. However, it has a frustrating bug when it comes to Hebrew text (I'm Israeli); it struggles to handle it properly.

My current workaround is to open the file with GIMP, export it immediately, and then open it with Draw.

My goal is to write a script that can export the PDF into individual PNG pages and then merge them back together. So far, I haven't come across any tools that can perform these actions directly from the terminal.

Ideally, if there is a standalone tool capable of accomplishing this task, it would be perfect for my needs.

I am using Fedora 38.

Any assistance would be greatly appreciated.

1 Answer 1


You can try combination from pdftoppm and convert from ImageMagick.

To convert from pdf to png you can use command:

pdftoppm input.pdf output -png

this will produce png files like output-1.png, output-2.png and so on.

To recreate pdf from png's you can use command:

convert output-*.png flat_output.pdf

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .