To sanitize a merger agreement PDF for a corporate lawyer before external due diligence on a Linux laptop, you must remove all hidden metadata, comments, annotations, and invisible content using a browser-based redaction tool that processes the file entirely on your device—so no copy of the sensitive agreement ever leaves your machine.
What You Will Need
- A Linux laptop (any recent distribution; the method is browser-based, so OS version is not critical)
- A modern web browser (Chrome, Firefox, or Edge—must support JavaScript and local file processing)
- The original merger agreement PDF file (ensure you have write access to the file location)
- One of the following sanitization tools:
- OctopusPDF Redact / Sanitize (free tier: 3 conversions/day, files up to 20 MB; Pro: unlimited, files up to 100 MB, batch mode) [K2]
- pdf-redact-tools (open-source command-line utility, installable via
aptorpip) - ExifTool (command-line metadata cleaner, available in most Linux package repositories)
- qpdf (command-line tool for PDF structural cleanup, including object stream removal)
- A secondary PDF viewer (e.g., Evince, Okular) to verify the output file
- Optional: a checksum utility (
sha256sumis pre-installed on most Linux distributions)
Step-by-Step Instructions
Step 1. Prepare the Original File and Verify Its Integrity
Before sanitizing, create a SHA-256 checksum of the original merger agreement PDF. This gives you a verifiable baseline to confirm the sanitized version contains the same visible content.
sha256sum merger_agreement_draft.pdf
Record the output hash in a secure note. Then create a backup copy of the file in a separate directory:
cp merger_agreement_draft.pdf /path/to/backup/
Why this matters: If anything goes wrong during the sanitization process, you can restore the original from backup. The checksum also lets you prove to the corporate lawyer that the visible content did not change between versions.
[Insert screenshot: Terminal window showing sha256sum output and cp command]
Step 2. Inspect the PDF for Hidden Metadata and Comments
Open the merger agreement PDF in a PDF viewer that exposes document properties. In Evince (default on many Linux distributions), go to File → Properties. Look for:
- Author name
- Company or organization name
- Creation date and modification date
- Software used to create the PDF
- Keywords or subject fields
Next, check for comments and annotations. In Evince, click the sidebar icon and select the "Annotations" tab. In Okular, click Tools → Reviews. Scroll through every page and note any comments, highlights, sticky notes, or markup.
Watch out: Many users forget that comments often contain negotiation history and alternate clause language. A simple "Save As" in a PDF viewer does not remove these. You must use a dedicated redaction or sanitization tool.
Watch out: If the PDF was created from Microsoft Word or LibreOffice, the document metadata may contain the original author's full name and email address—information you do not want visible during external due diligence.
[Insert screenshot: Evince Properties dialog showing Author field and Annotations sidebar]
Step 3. Choose Your Sanitization Method Based on File Size and Volume
You have three main options for sanitizing the PDF on your Linux laptop:
| Method | Tool | Best For | File Size Limit | Data Leaves Device? |
|---|---|---|---|---|
| Browser-based local processing | OctopusPDF Redact/Sanitize | Single documents, users who prefer a GUI | 20 MB free, 100 MB Pro | No—runs locally in browser [K4] |
| Open-source command line | pdf-redact-tools | Multiple files, scripting | No hard limit | No—runs locally |
| Metadata stripping | ExifTool or qpdf | Quick metadata removal only | No hard limit | No—runs locally |
Why this matters: If the merger agreement is over 20 MB, the free tier of browser-based tools will not work. You would need either a Pro subscription or a command-line alternative. Command-line tools like pdf-redact-tools and ExifTool have no practical file size limits.
Watch out: If you are on a shared or company device, browser-based sanitization is still safe because the processing happens locally—the file is opened inside the browser tab, processed on your device, and the result downloads directly to your machine [K4][K5]. No upload occurs.
[Insert screenshot: Comparison of tool options table rendered as a clean list]
Step 4. Sanitize Using a Browser-Based Tool (Option A)
Navigate to the OctopusPDF Redact / Sanitize tool in your browser. The URL is https://octopuspdf.com/redact [K2].
- Click the file drop zone and select your merger agreement PDF, or drag and drop the file into the browser tab.
- Wait for the file to load. The tool processes the PDF entirely in your browser using PDF.js and pdf-lib libraries [K4].
- Review the file preview. The tool will identify metadata, comments, and hidden content.
- Click the Redact / Sanitize button.
- When processing completes, click Download to save the sanitized PDF to your Linux laptop.
Watch out: The free tier allows 3 conversions per day for files up to 20 MB [K2]. If you exceed this, you must wait 24 hours, upgrade, or switch to a command-line tool.
Watch out: Do not close the browser tab while processing is running. The entire pipeline—file opens, processes locally, downloads result—happens in one session [K4].
[Insert screenshot: OctopusPDF Redact tool interface showing file loaded and Redact button highlighted]
Step 5. Sanitize Using Command-Line Tools (Option B)
If you prefer command-line tools or need to process files larger than 20 MB, use open-source utilities.
First, install pdf-redact-tools:
sudo apt install pdf-redact-tools # Debian/Ubuntu
# or
sudo dnf install pdf-redact-tools # Fedora
Then run the sanitization:
pdf-redact-tools --sanitize merger_agreement_draft.pdf
This creates a sanitized output file (typically named merger_agreement_draft_sanitized.pdf) with metadata stripped and hidden content removed.
To specifically strip metadata with ExifTool:
sudo apt install exiftool # if not already installed
exiftool -all= merger_agreement_draft.pdf
This wipes all EXIF and XMP metadata fields from the PDF. Note that ExifTool modifies the file in place, so make sure you have a backup (Step 1).
To remove hidden object streams and rebuild a clean structure with qpdf:
sudo apt install qpdf
qpdf --linearize --object-streams=disable merger_agreement_draft.pdf sanitized_merger_agreement.pdf
Watch out: Command-line tools are powerful but require care. Running exiftool -all= overwrites the original file. Always work on a copy.
[Insert screenshot: Terminal showing pdf-redact-tools and exiftool commands with output]
Step 6. Verify That All Sensitive Content Has Been Removed
Open the sanitized PDF in a fresh PDF viewer instance (do not reuse the previous window). Check:
- Metadata: Go to File → Properties. The Author, Title, Subject, Keywords, and Creator fields should be empty or show generic values.
- Comments/Annotations: Open the annotations sidebar. There should be zero comments, highlights, or sticky notes.
- Hidden text: Use the text selection tool and drag across the entire page. No invisible text should appear.
- Page count: Confirm the page count matches the original.
Next, run a command-line verification with ExifTool to confirm no metadata remains:
exiftool sanitized_merger_agreement.pdf
The output should show only basic file information (file size, file type, MIME type) and no author, creator, or creation date fields.
Watch out: Some PDF viewers cache metadata. If you opened the file before sanitization and then overwrite it, the viewer may still display old metadata. Always close the viewer completely and reopen the file.
[Insert screenshot: PDF Properties dialog showing empty author/title fields and empty annotations sidebar]
Step 7. Recalculate the Checksum and Compare Visible Content
Run SHA-256 on the sanitized file:
sha256sum sanitized_merger_agreement.pdf
The hash will differ from the original—that is expected because metadata and hidden content removal changes the file structure. To verify that the visible content is unchanged:
- Open the original backup and the sanitized file side by side in two viewer windows.
- Visually compare each page—headings, body text, tables, signatures, and page numbers must match.
- For a more rigorous check, convert both PDFs to plain text and diff them:
pdftotext merger_agreement_draft.pdf original.txt
pdftotext sanitized_merger_agreement.pdf sanitized.txt
diff original.txt sanitized.txt
No differences should appear in the output.
[Insert screenshot: Terminal showing diff command with no output (indicating identical text content)]
Step 8. Rename and Protect the Sanitized File
Give the sanitized file a clear, professional name that signals its clean status:
mv sanitized_merger_agreement.pdf merger_agreement_due_diligence_clean.pdf
If the file contains extremely sensitive clause details, consider encrypting it before sending:
pdftk merger_agreement_due_diligence_clean.pdf output merger_agreement_encrypted.pdf user_pw yourpassword
Or use QPDF for encryption:
qpdf --encrypt yourpassword yourpassword 256 -- merger_agreement_due_diligence_clean.pdf merger_agreement_encrypted.pdf
Why this matters: A clean file still contains the agreement's full text. Encryption adds a layer of protection during transmission to the external due diligence team.
Watch out: Do not use the same password for the PDF that you use for other accounts. Generate a unique password and share it through a separate channel (e.g., phone call) from the file transfer.
[Insert screenshot: Terminal showing rename and qpdf encryption commands]
Step 9. Deliver the Sanitized File to the Corporate Lawyer
Transfer the sanitized file to the corporate lawyer using a secure method:
- Encrypted email attachment
- Secure file-sharing service
- On an encrypted USB drive delivered in person
Include a brief note stating:
"This document has been sanitized. Metadata, comments, annotations, and hidden content have been permanently removed. Visible content matches the original merger agreement of [date]. Checksums and verification results are available upon request."
Watch out: Do not simply rename the original file and send it. Renaming does not remove metadata or comments. The sanitization step is mandatory.
[Insert screenshot: Draft email with the sanitized PDF attached and the verification note]
Common Mistakes / Troubleshooting
| Problem | Likely Cause | Fix |
|---|---|---|
| Author name still appears in PDF properties after sanitization | You used a PDF viewer's "Save As" instead of a dedicated sanitization tool | Re-run the sanitization with OctopusPDF Redact/Sanitize, pdf-redact-tools, or another dedicated tool [K2] |
| File size exceeds 20 MB and browser tool refuses to process it | Free tier limit reached [K2] | Switch to pdf-redact-tools or qpdf command-line tools, or upgrade to Pro (100 MB limit) |
| Comments/annotations still visible in the output | You sanitized a copy but the viewer cached the old version | Close all windows of the PDF viewer, then reopen the sanitized file fresh |
| Command-line tool outputs "No such file or directory" | Path contains spaces or special characters | Quote the file path: pdf-redact-tools --sanitize "merger agreement draft.pdf" |
| After sanitization, some pages look different (fonts, layout) | The sanitization tool may have recompressed or re-rendered the PDF | Compare both versions' checksums and visual appearance; if critical, re-create the PDF from source and re-sanitize |
How to Verify Success
- Author, company, and keyword fields in PDF Properties are empty
- Annotations sidebar shows zero comments or highlights
- ExifTool command shows no metadata fields beyond file system basics
-
diffof extracted text shows no differences between original and sanitized versions - Page count matches the original merger agreement exactly
- The sanitized file opens normally in a fresh PDF viewer instance
- You have a backup of the original file stored separately from the sanitized version
- The sanitized file hash differs from the original (expected) but visible content is identical
FAQ
Q1. Can I just use LibreOffice or a PDF viewer to remove metadata?
No. Standard PDF viewers and office suites typically do not have a true sanitization feature. They may allow editing metadata fields, but they do not remove comments, annotations, and hidden content embedded in object streams. You need a dedicated redaction or sanitization tool that physically deletes this content [K2]. Attempting to clean a PDF with a general-purpose editor will leave traces detectable with command-line inspection tools.
Q2. Is browser-based sanitization safe for confidential merger agreements on a shared Linux laptop?
Yes, provided the tool runs entirely locally. OctopusPDF, for example, processes PDFs in the browser using PDF.js and pdf-lib libraries, and the file never uploads to a server [K4]. The pipeline is: user drops the file into the browser tab, it opens locally, gets processed on the device, and the result downloads directly to your machine [K4]. This makes browser-based sanitization safe even on shared or company devices, because no third party ever receives the file [K5].
Q3. What is the difference between "redact" and "sanitize" in PDF tools?
In the context of PDF privacy tools, both terms are often used together. Redaction typically refers to permanently removing visible text or images from the document body (e.g., blacking out a clause). Sanitization refers to removing hidden data—metadata, comments, annotations, hidden layers, and revision history. The OctopusPDF Redact/Sanitize tool performs both functions: it "physically deletes metadata, comments and hidden content before sharing" [K2]. For a merger agreement going to external due diligence, you generally want both: redaction removes specific sensitive clauses, while sanitization cleans all traces of authorship and editing history.
Key Facts
- PDF sanitization removes metadata, comments, annotations, and hidden content that standard "Save As" operations leave intact [K2].
- Browser-based sanitization tools like OctopusPDF process files 100% locally using PDF.js and pdf-lib, so documents never upload to a server and remain safe on shared devices [K4][K5].
- OctopusPDF's free tier allows 3 sanitizations per day for files up to 20 MB; Pro removes limits and supports 100 MB files with batch processing [K2].
- Command-line alternatives on Linux include pdf-redact-tools, ExifTool (for metadata only), and qpdf (for object stream cleanup), all of which run locally with no file size limits.
- Verification of a sanitized PDF requires checking document properties (author/title fields), annotations sidebar (no comments), and comparing extracted text (via
pdftotextanddiff) between the original and sanitized versions.