Extends the contao file manager to clean up the metadata of PDF files for privacy reasons.
The following two commands are executed in the prozess:
$ exiftool -all= -Author='' -tagsfromfile @ -title -keywords -subject -description file.pdf -o intermediate.pdf
$ qpdf --linearize intermediate.pdf file.pdf
# config/config.yaml
contao_pdf_metadata:
exiftool:
# Path to the exiftool binary.
path: /usr/bin/exiftool
# Environment variables when running exiftool.
env:
# Prototype
name: ~
qpdf:
# Path to the qpdf binary.
path: /usr/bin/qpdf
# Environment variables when running qpdf.
env:
# Prototype
name: ~
# Clean up the metadata of PDF files immediately after uploading.
cleanup_on_upload: false
# Overwrites metadata fields in the cleaned PDF file.
metadata:
author: ''
To clean up the metadata of PDF files in the files/
directory, you can use the following command:
$ vendor/bin/contao-console pdf-metadata:clean [<path>]