PDF Batch Processing: The Only 'Done' Is a Second Extraction's Count
A PDF batch that looks successful can archive missing pages or unredacted personal data, and redaction mistakes can't be undone once the file is public. Verification must be a second extraction that counts, not a human scan of the output.
Batch PDF jobs produce output files without erroring while pages silently disappear. A Python pipeline for archiving course materials demonstrates why each step needs a second pass. After splitting, the script counts actual /Type /Page objects in the content stream, not just the /Count metadata value, because incremental updates can leave orphan objects that inflate the count. After extraction, pages that return empty strings are flagged separately; an empty string usually means a scanned image, not an empty page, and the extractor won't tell you.
The strictest check is redaction. Drawing a black rectangle over author names and answer keys leaves the underlying Tj line in the content stream; re-extraction still finds the sensitive terms. Only removing the entire Tj line brings the count to zero. The pipeline classifies operations as reversible or irreversible before deciding how strict to be: reversible mistakes cost a re-run, irreversible ones cost a public leak. A final checklist keeps declared page count, actual object count, and 'no text layer' as separate columns, because three of five test files failed silently—two scanned pages, a truncated file, and a metadata mismatch—without any script error.
Classifying operations by whether a mistake can be re-run is a more practical driver for verification strength than a blanket 'test everything' rule; it concentrates effort on the irreversible redaction step.
PDF's separation of graphics layer from content stream means visual inspection can never confirm redaction; only a re-extraction over the parsed stream can prove the sensitive text is gone.
Silent failures dominate PDF batch work: the three flagged files in the sample all passed normal success criteria—no error, output present—and were only caught because the checklist had explicit columns for 'can open' and 'no text layer'.
Running the checklist as a post-processing summary is backwards; it has to run first to shape the rest of the pipeline, which is why the article's sample treats it as the final step but notes the awkwardness.
The step of re-extracting text after redaction cannot be skipped.