Skip to content

Extends the contao file manager to clean the metadata of PDF files

License

Notifications You must be signed in to change notification settings

postyou/contao-pdf-metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contao PDF Metadata

Extends the contao file manager to clean up the metadata of PDF files for privacy reasons.

Packagist Version

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

Requirements

  • ExifTool installed on the system
  • QPDF installed on the system

Configuration

# 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:               ''

Console Command

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>]

About

Extends the contao file manager to clean the metadata of PDF files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages