Set safe file-size limits for PDF processing
3 November 2026
Set the file-size threshold in bytes and write down whether the exact limit is allowed. Then test a valid PDF one byte below, one exactly at, and one byte above that limit. Watch what happens to a separate ordinary job while the service decides whether to admit each file. A size limit is a control to verify in your own environment, not a universal safe file size.
Get the unit and the comparison right
For a fictional boundary, suppose the buyer permits a PDF of up to and including 10,000,000 bytes. That is 10 decimal MB. A policy specifying 10 MiB instead would mean 10,485,760 bytes. Copying a rounded number from a file-manager display could therefore put a test on the wrong side of the configured threshold.
| Control | Exact file bytes in this example | Expected result for this size check |
|---|---|---|
| Immediately below | 9,999,999 | Within the limit |
| Exactly at | 10,000,000 | Within the inclusive limit |
| Immediately above | 10,000,001 | Too large |
Other checks, such as permissions and PDF validity, still apply. Prepare harmless valid test files, record their digests and byte counts, and ask the service owner to confirm the measured object. A limit on the complete HTTP request may count multipart overhead; a limit on the document payload need not. Record the affected route rather than assuming they measure the same thing.
The upload worksheet proposes tests below and above a configured limit. Both result columns are empty. The exact-boundary test adds the distinction between an inclusive and an exclusive rule. Benign upload tests
Record which component made the decision
For each submission, retain the request identity, configured rule, client response and first component that declined or admitted it. Check whether a processing job or temporary record was created. An observed rejection at an upstream proxy differs from a rejection by a downstream worker. Neither the response code nor its timing can be supplied by a planning template.
Run a small pre-agreed control job alongside the test if concurrent processing matters. Record its queue and completion times and compare them with a measured baseline. A single run can reveal a symptom but cannot establish its cause or promise zero impact.
If the exact-limit result disagrees between the documented policy, the interface and the API, ask the service owner to reconcile the unit and comparison operator at each point. Repeat on the affected routes and retain the results before approving the boundary.
Part of the Assess security controls for PDF uploads guide.
Preserve SharePoint file identity during PDF processing
This section answers a narrower question than the rest of this page, and it does not mint a new URL. The original contribution preserved here is a synthetic library-to-processing-to-library sequence with reconciliation logs.
The file that comes back must be the file you sent, or a named successor. Count identities, not only successes.
| Point | Identity you recorded | Identity you read back | Same file? |
|---|---|---|---|
| Before processing | Library id and version | — | — |
| After processing | The id you expected to return | The id that returned | Not run |
Labelled synthetic case. Send one sample and expect one return. A second file, or a return with a new id you did not record, is a reconciliation exception.
The rest of this page remains the parent decision. Use the table for the question in the heading, and leave a cell blank rather than filling it from memory.
Set per-job limits for document processing
This section answers a narrower question than the rest of this page, and it does not mint a new URL. The original contribution preserved here is an API contract, synthetic batch and partial-failure reconciliation log.
A limit is part of the contract. Write the limit you will enforce per job, and what a partial failure leaves behind.
| Case | Limit | What you sent | What remains | Reconciled? |
|---|---|---|---|---|
| Inside the limit | The number you set | A small batch | The outputs you expected | Not run |
| Past the limit | The same | One item over | Must be explicit, not silent | Not run |
| A failure halfway | The same | A batch | Named items done and not done | Not run |
Labelled synthetic case. Run a batch of harmless files and stop one on purpose. The log should say which items finished. A single “failed” for the whole batch is not reconciliation.
The rest of this page remains the parent decision. Use the table for the question in the heading, and leave a cell blank rather than filling it from memory.
Identify memory limits in large PDF operations
This section answers a narrower question than the rest of this page, and it does not mint a new URL. The original contribution preserved here is a documented load profile, raw results and capacity interpretation.
A limit is a number you measured or a number the supplier stated. This article contains neither.
| Question | Figure | Source | What it does not mean |
|---|---|---|---|
| The limit in the heading | Blank until you measure it or read a dated statement | Your test or the supplier | A catalogue label is not a capacity |
Record the file size, the concurrency and the build you used. Do not copy a figure from memory.
The rest of this page remains the parent decision. Use the table for the question in the heading, and leave a cell blank rather than filling it from memory.
Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).
