Bounded redacted PDF submission guide

Keep a submission PDF under 1 MiB: verify redaction, order and final size

Fix the redaction scope first, verify A/B/C order and readability, then measure the saved PDF itself against 1,048,576 bytes.

Fix the numeric conditions

This synthetic case uses three pages, A4 portrait and 1 MiB = 1,048,576 bytes. That is different from 1 MB = 1,000,000 bytes. It is an explanatory boundary, not an official rule from a particular receiving site; check the destination separately.

ConditionThis caseCheck
Pages3saved PDF
Sizeat most 1,048,576 bytesactual PDF
PaperA4 portraitpage metadata

Keep the source images

source-A/B/C.png are synthetic 800x1200 images. Keep originals separate from the submission artifact. The order is fixed as A → B → C in source-order.csv. The fictional string DEMO_PRIVATE_V30 on B is the page-2 redaction target.

A → page 1
B → page 2
C → page 3
Fix page order before encoding.
x=100, y=100
w=200, h=60
alpha=255
Record the opaque redaction rectangle.

Redact, resize, then make the PDF

Apply an opaque fill to the target area first. Place only the processed bitmap into the A4 portrait pages, then create the PDF. Do not return to the original image when saving, and do not treat a visual preview alone as completion. Page 2 of the sample covers the area in black.

  1. Preserve the original and target rectangle.
  2. Resize and encode only the redacted bitmap.
  3. Create a three-page PDF in A/B/C order.
  4. Save it, then measure the actual file bytes.

Measure the saved PDF bytes

Measure final-submission.pdf itself, not the sum of image sizes or a setting. This fixture is three pages and 95,630 bytes, below 1,048,576 bytes. If it exceeds the bound, record current bytes and the excess; do not endlessly destroy readability.

pages = 3
pdf_bytes = 95630
maxBytes = 1048576 → PASS

Reopen and check three things

Reopen the saved PDF independently and confirm (1) the page-2 target is hidden, (2) pages are A/B/C in the right order, and (3) the text remains readable. Check that source images and unnecessary metadata are not attached. Automation cannot guarantee complete sensitive-data detection or acceptance.

A file-contract check is different from actual receiving-site acceptance. The person submitting must confirm the final saved file and destination; this guide does not submit automatically.

Treat failures as failures

negative-too-small-limit.json records an unreachable 100-byte bound. negative-out-of-bounds.json records a rectangle outside the image, and negative-cancelled-output.json records stale output after cancellation. Never call a damaged or old PDF ready.