Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

PDF Sanitizer

1 sites No security coverage Drupal 9–10 · not 11 PDF ecosystem
View on drupal.org

The PDF Sanitizer module automatically cleans uploaded PDF files by removing potentially malicious content like JavaScript, ensuring only safe documents are stored and shared. This protects your website and visitors from security risks associated with untrusted PDF uploads.

Enhance your Drupal site's security by automatically sanitizing uploaded PDF files. The PDF Sanitizer module removes malicious content like JavaScript actions, ensuring only safe PDFs are stored. This module provides a crucial security solution for any Drupal site that allows users to upload PDF documents, protecting both your server and your site's visitors from potentially harmful embedded content.

Features

The PDF Sanitizer module provides a crucial security layer for Drupal sites that allow users to upload PDF files. Its basic functionality is to automatically intercept and process any PDF file uploaded through standard Drupal file upload mechanisms (e.g., file fields, media library).

What makes this module unique is its use of the powerful Ghostscript utility to perform deep sanitization. It specifically targets and removes potentially malicious content, such as embedded JavaScript actions, which could otherwise pose a security risk to users viewing these PDFs.

Someone would use this module whenever they need to ensure the integrity and safety of PDF files uploaded by users or external sources. Common use cases include:
* Websites where users submit documents (e.g., job applications, forms).
* Content management systems where editors upload PDF resources.
* Any scenario where you want to mitigate risks associated with untrusted PDF content.

By automatically replacing the original uploaded file with its sanitized version, the module ensures that only clean and safe PDFs are stored on your server and served to your site's visitors.

Post-Installation

Once installed and enabled, the PDF Sanitizer module works automatically in the background. There are no configuration pages, new content types, or text format settings to manage. Simply enable the module, and it will begin sanitizing PDF files as they are uploaded.

Additional Requirements

This module requires the following:
* Ghostscript: A system-level executable that must be installed on your server and accessible from the command line. Refer to the module's README.md file for installation instructions for various operating systems (Linux, macOS, Windows, DDEV).
* PHP 8.1 or higher
* Drupal 9 or 10

Currently, there are no specific modules or libraries recommended to enhance the core functionality of the PDF Sanitizer module.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.0 Stable 9–10 Aug 6, 2025
1.0.x-dev Dev 9–10 Aug 5, 2025