My *nix world

Fix PDF file for epdfview

I don't know why but there are PDF files which cannot be opened by app-text/epdfview.

I found a solution which seems to fix PDF file in almost all the situations:

  • convert the PDF to PostScript file
  • convert the PostScript file back to PDF file

I am using the GhostScript for this but you can use also the pdf2ps and ps2pdf utilities for that.

To reuse this logic later I have wrote a bash script (fixpdf) which automates these steps:


Also, I have created a menu-context shortcut in the file explorer application I use in Xfce : thunar.
For this I choose Edit->Configure custom action, I've added a new action with the following values:

  • name = Fix PDF file
  • command=fixpdf %f "" epdfview %f

Note: I've appended the """ epdfview %f" to the "fixpdf %f" command because I want that my PDF viewer (app-text/epdfview) to open the fixed file right after the file is fixed.

Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.

 
The following two tabs change content below.
Fix PDF file for epdfview

Eugen Mihailescu

Founder/programmer/one-man-show at Cubique Software
Always looking to learn more about *nix world, about the fundamental concepts of math, physics, electronics. I am also passionate about programming, database and systems administration. 16+ yrs experience in software development, designing enterprise systems, IT support and troubleshooting.
Tagged on: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: