Commit Graph

4 Commits

Author SHA1 Message Date
Jeremy Singer-Vine 8f571bb49a Remove no-longer-guaranteed test_repair assertion 2025-11-08 15:05:15 -05:00
Jeremy Singer-Vine 48cab3f73e Change default .repair(...) setting h/t @Laubeee
Now passes "default" rather than "prepress" to Ghostscript's
`-dPDFSETTINGS` parameter.

Also makes that setting modifiable via `.repair(setting=...)`, where the
value is one of `"default"`, `"prepress"`, `"printer"`, or `"ebook"`.

See #874 and https://ghostscript.com/docs/9.54.0/VectorDevices.htm
2024-07-31 18:16:00 -04:00
Jeremy Singer-Vine f6887b5b33 Add gs_path argument to .open(...) & .repair(...) 2023-08-06 17:24:00 -04:00
Jeremy Singer-Vine db6ae97bfb Add pdfplumber.repair(...) and .open(repair=True)
This commit adds convenience methods to repair PDFs on the fly and/or to
write repaired PDFs to disk.

Currently, this does so via Ghostscript using the method we've asked
many users to try by following the instructions at
https://superuser.com/questions/278562/how-can-i-fix-repair-a-corrupted-pdf-file

Now, hopefully, this saves folks a few steps.
2023-07-16 17:07:42 -04:00