Commit 5270071b authored by jvoisin's avatar jvoisin
Browse files

Remove a couple of residual metadata in pdf

This commit takes care of removing residual metadata
added by mat2 during the cleaning of pdf.
parent 5312603a
Pipeline #34337 failed with stages
in 10 minutes and 44 seconds
......@@ -122,6 +122,17 @@ class PDFParser(abstract.AbstractParser):
document.set_creation_date(-1)'file://' + os.path.abspath(out_file))
# Cairo adds "/Producer" and "/CreationDate", and Poppler sometimes
# fails to remove them, we have to use this terrible regex.
# It should(tm) be alright though, because cairo's output format
# for metadata is fixed.
with open(out_file, 'rb') as f:
out = re.sub(rb'<<[\s\n]*/Producer.*?>>', b' << >>',, 0,
with open(out_file, 'wb') as f:
return True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment