postyou / contao-pdf-metadata
扩展Contao文件管理器,用于清理PDF文件的元数据,以保护隐私。
2.0.0
2023-03-08 09:33 UTC
Requires
- php: ^8.0
- contao/core-bundle: ^4.13
- psr/log: >=1.1
- symfony/config: ^5.4 || ^6.0
- symfony/console: ^5.4 || ^6.0
- symfony/dependency-injection: ^5.4 || ^6.0
- symfony/filesystem: ^5.4 || ^6.0
- symfony/http-kernel: ^5.4 || ^6.0
- symfony/process: ^5.4 || ^6.0
Requires (Dev)
- contao/manager-plugin: ^2.0
- friendsofphp/php-cs-fixer: ^3.12
Conflicts
- contao/manager-plugin: <2.0 || >=3.0
README
扩展Contao文件管理器,用于清理PDF文件的元数据,以保护隐私。
以下两个命令在过程中执行
$ 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: ''
控制台命令
要清理files/
目录中PDF文件的元数据,可以使用以下命令
$ vendor/bin/contao-console pdf-metadata:clean [<path>]