Some Files Report an Error Message When Trying To Alter Them in PDF-Tools
When trying to perform tasks on a document in PDF-Tools, I'm getting an error message resembling the following:
The document is damaged and, if possible, needs to be repaired.
PDF-Tools isn't always capable of repairing the damage on a document. In cases like these, you will need to use the Editor or Viewer
**Note: Neither The Editor, nor Viewer, is always capable of repairing the damage - sometimes a document is just damaged beyond repair. If this is the case, it will need to be re-authored or re-acquired.
Open the document in the Editor or Viewer and you should see a warning sign in the document tital bar:
If you click the yellow triangle, it should bring up a dialogue box instructing you to re-save:
Do exactly that, using the "Save As" function under File --> Save As.
You should now be able to use PDF-Tools to alter the file without issue.
**Note: If it isn't possible for the Editor or Viewer to repair the damage, then you will see an error message similar to this: