How to repair a pdf? #511
Replies: 6 comments
-
pikepdf auto-repairs many files. It's hard to say what is wrong with your file without more detail, and not all files are repairable. When the error is that some referenced object is missing, for example, there is probably no way to repair that, unless you can regenerate the PDF from its source documents. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the clarification and the explanation. I am currently using the
I was hoping to replace the script with a pure Python solution, however:
|
Beta Was this translation helpful? Give feedback.
-
Since I can't debug an issue without a reproducing file. |
Beta Was this translation helpful? Give feedback.
-
Over the last days, I ran a verification script on several hundred PDF files and found 10 with this issue. Unfortunately, they all contain copyrighted material so I can not share them. What I can provide is a list of the type of warnings Maybe they can provide you some insight until I encounter a PDF file that I can share... Types of warnings from
Tested with pikepdf 8.4.0 and qpdf 11.5.0 Should I create an issue for this? |
Beta Was this translation helpful? Give feedback.
-
I think it's that pikepdf.Pdf.open() defaults to enabling repairs, so it fixes many of the issues qpdf --check would otherwise report and fix. Those errors are all fairly innocuous, except "page 0 has shared identifier entries". |
Beta Was this translation helpful? Give feedback.
-
Converting this into an issue after I finally found some sample pdf's that I believe can be shared. |
Beta Was this translation helpful? Give feedback.
-
The documentation briefly mentions that with
pikepdf
, it is also possible to repair a pdf file.I see that there is a
pdf.check()
function, however, I could not find any explanation how to proceed when this function returns warnings or errors.Thank you,
Guy
Beta Was this translation helpful? Give feedback.
All reactions