Half the client bank statements will not open in the pipeline at all
In short
Classify the failure before retrying anything. A client PDF that will not process is one of four things: encrypted with a user password only the client knows, readable but fenced off by permission flags, damaged in transfer, or an image with no text layer. Each has a different owner, and only one of the four should end with the firm holding a client's password.
Key takeaways
- Four failure classes hide behind one error: user password, permissions, damage, and no text layer.
- A file that opens with an empty user password is not locked; something else stopped the job.
- Whether you may bypass a permission flag is a question of authority, not of tooling.
- Never accept a password in the same channel as the document, and never store it in the ticket body.
- An image-only statement opens perfectly and still yields nothing until it goes down an OCR path.
A queue of client files failing at the first step is not one problem. It is four, needing four different responses: a file encrypted with a user password, a file that opens normally but forbids text extraction, a file damaged in transfer, and a photograph of a statement with no text in it at all. Retrying the job helps none of them. Classifying the failure resolves most without contacting anybody.
Password protected bank statement PDF automation is where firms lose the most time, because the obvious response — ask the client — is the slowest possible one and is often unnecessary. A large share of files that look locked are not locked to a reader at all; they are locked to a copier, which is a different flag with a different answer.
Classify the failure before anyone retries or re-requests
- Capture the exit code and the error string, not just failed. The Xpdf and poppler command-line tools separate these cleanly: exit code 1 means the file could not be opened, exit code 3 means the problem was permissions. Two distinct routes, one boolean away from being indistinguishable in your logs.
- Ask the file what it thinks it is. A metadata probe such as pdfinfo reports whether the document is encrypted and, when it is, prints the print and copy permissions it declares. Store that output on the job record; it is the evidence for whichever branch you take next.
- Try opening with an empty user password. Files carrying only an owner password open with no password at all, and a pipeline that treats encrypted as locked will send a needless request to a client for a file it can already read.
- Count extractable characters per page. A file that opens, reports 8 pages and yields 0 characters is an image, not a locked document, and belongs on an OCR path rather than in a password queue.
- Compare the stored byte length against what the sender declared, where the channel gives you one. A file truncated by an upload that dropped mid-transfer produces a parser error that looks exactly like corruption, and re-requesting it succeeds first time.
| Class | What you observe | Who resolves it | First action |
|---|---|---|---|
| User password | Open fails; the library asks for a password; an empty password is rejected | The client, or the bank's portal | Request an unlocked export, and only then a password |
| Owner password and permission flags | The file opens; extraction is refused or returns nothing; a permissions error code | Your own policy, with the client's written authority | Record the flag, decide the authority question before touching the file |
| Damaged or truncated | Structural parse error, byte length short, or the last pages are missing | Whoever sent it, via the same channel | Re-request the identical file before anything else |
| No text layer | Opens cleanly, correct page count, 0 extractable characters | Nobody — it is a valid file | Route to OCR and expect lower field confidence |
The password the bank derives from something the client knows
Statements emailed by a bank are frequently protected with a password derived from data the account holder already has: a date of birth, part of an identity or account number, a customer reference. The rule is usually stated in the covering email and varies by bank, by product and by country, so a firm collecting statements for 40 clients across 15 banks meets 10 or more conventions in a single month.
Two responses are defensible and one is not. Defensible: ask the client to supply the file again from the bank's own portal, where downloads are typically unprotected, or ask for a structured export in place of the PDF, which removes the whole class of problem and improves everything downstream. Not defensible: building anything that derives or guesses passwords from client data you hold. Even where it would work, it converts a document-processing system into a credential-guessing system, and that is not a conversation any firm wants to have with a client or an insurer.
The file opens perfectly and the text is fenced off
A PDF can carry restrictions without carrying a password that a reader needs. The document declares what it permits — printing, copying, modification — and a conforming reader honours those declarations. The distinction matters operationally, because these files display fine on a partner's screen while every extraction job against them fails, which is exactly the pattern that gets logged as a mysterious parser bug.
The tooling makes the boundary visible. The poppler utilities document an owner-password option whose stated effect is to bypass all security restrictions, and they return a permissions-specific exit code when they refuse. So the technical question is trivial and the real question is not technical at all: does the firm have authority to override a restriction the bank set on a document the client owns? Get that answer in writing from the client, record it against the engagement, and take local advice on whether anything further applies in your jurisdiction. This page is engineering guidance, not legal advice.
Damaged in transfer, and the ones that were never text
- Truncated uploads. A mobile client on a weak connection produces a file that is structurally a PDF for most of its length and then stops. The parser error names a broken cross-reference or an unexpected end of file, and the fix is to ask for the same file again rather than to change the parser.
- Rewritten by something in the middle. Mail gateways, archiving tools and chat apps re-encode attachments, and a re-encode can flatten text to images or strip an embedded font. The tell is that the client's copy extracts fine and yours does not.
- Printed and rescanned. A clean digital PDF, printed, signed and scanned back, is now an image at whatever the device defaulted to — often 150 or 200 dpi, against the 300 dpi recognition engines generally want. Nothing is broken; everything is worse.
- A photograph in a PDF wrapper. Phone scanning apps produce valid documents with 0 characters of text. They open, they page correctly, and they need OCR — plus the quality gate that belongs at capture rather than in the queue.
- Image-only files degrade more than the amounts. Recognised narration strings are noisier than digital text, which means counterparty names come through inconsistently and land you in one supplier arriving under six different names even when every figure is read correctly.
Where a client's key lives, and for how long
The moment a firm accepts a password it has accepted a custody problem, so the design should shorten how long that lasts. Take the credential on a channel separate from the document, hold it for the 1 job that needs it, and delete it on completion. Where statements arrive monthly and the password is stable, resist storing it in the client record: a secrets store with scoped access and an expiry measured in hours is the least you should accept, and asking again each period is better.
- Never in the ticket. A password pasted into a support ticket, an email thread or a shared inbox is now in every backup, every export and every search index the firm owns.
- Never in the same message as the file. If both arrive together, the credential adds no protection and should be treated as already exposed.
- Log the use, not the value. The job record should say a credential was supplied, by whom, at what time and for which document — and never contain the credential.
- Decrypt once, into a working copy. Re-supplying the password to every downstream step multiplies the number of places it can be captured.
- Say what you actually do. We hold no security certifications and do not claim any; what a firm can reasonably ask of a build is that the handling design is written down, testable and reviewed by its own advisers.
A pipeline that can read a restricted document is an engineering fact. Whether it should is a question about authority, and the answer belongs in the file, not in the code.
What the failed-file queue has to hold to be useful
The queue is the product here. A file that could not be opened still needs a stable internal reference from the moment it arrived, because everything afterwards — the request to the client, the retry, the eventual match to an engagement — hangs off that identity, the same argument made for the lifecycle of an invoice reference number. Record the failure class, the probe output, the client and engagement, the period the file appears to cover, every attempt with its timestamp, and what was asked of whom.
Then measure it by class rather than in aggregate. A firm with 300 failures a month made up of 240 image-only files has an intake problem to solve at capture; the same 300 made up of 240 permission-restricted files has a client-authority conversation to have once and never again. One number cannot tell those apart, and building the view that can is ordinary internal tools and ops work.
Opening the file is the beginning of the checks, not the end
A decrypted statement is still an unvalidated statement, and the gates behind this step catch the real damage. Statements must prove their own completeness before anything is posted; invoices must satisfy their own arithmetic, which is where line items that do not sum to the invoice total get caught. Neither check runs on a document the pipeline never opened, which is why a large queue here makes everything downstream look healthier than it is.
One boundary case is worth naming. A client who sends 1 file containing 6 months of statements has not sent a locked document at all, and it will fail differently: the file opens, and the splitter has to decide where 1 statement ends and the next begins, which is a batch scan splitting into the wrong number of documents. Keep the two queues apart, or one class of failure will mask the other in every report you produce about extraction and classification of source documents inside the accounting and tax systems we build.
Frequently asked questions
Short answers to the follow-ups this page tends to raise.
What is the difference between a user password and an owner password on a PDF?
A user password is required to open and view the document; an owner password governs what a reader is permitted to do once it is open, such as printing or copying text. A file carrying only an owner password opens with an empty password, which is why a pipeline that treats every encrypted file as locked generates client requests it never needed to send.
Should an accounting firm store client bank statement passwords?
Prefer not to hold them at all. Ask for the portal download or a structured export, which removes the credential from the process entirely. Where a password is unavoidable, take it on a channel separate from the document, hold it for the 1 job that needs it, delete it afterwards, and log that a credential was used rather than the credential itself. A password sitting in a ticket body is in every backup and search index the firm owns.
Why does a bank statement PDF open on screen but return no text to the pipeline?
Because the document declares permission restrictions that a conforming reader honours, and text extraction is one of the things it can forbid. The file is not encrypted against a viewer, so it looks perfectly normal to a person while every automated job against it fails. Confirm it with a metadata probe that prints the declared permissions, then treat the override as a question of client authority rather than a tooling choice.
How do you tell a scanned statement from a digital one automatically?
Count extractable characters per page. A digital statement returns thousands; a scan or a phone photograph returns 0 or a handful from an incidental text object. Make that count a routing signal at intake rather than a discovery made three steps later, because an image-only document needs OCR, a different confidence policy, and usually a better capture from the client.
- document intake
- bank statements
- PDF handling
- client data
The work behind this page
Builds from our portfolio that this page draws on.
AskVault
An AI internal knowledge-search platform that answers employee questions from your own docs — grounded in citations, with knowledge gaps surfaced and deflection tracked.
Productivity AIAP Copilot
An AI accounts-payable copilot that reads invoices, matches them to POs, and routes clean approvals
FintechNotewell
An AI meeting assistant that records and transcribes every meeting, extracts the decisions and action items, assigns owners and due dates, and tracks follow-through until it's done.
Productivity AIRead next
- Extracted statement: closing balance does not equal opening plus movementsA bank statement proves its own completeness. Foot it page by page, and the size and sign of the difference tell you which row was dropped, duplicated, inverted or invented.diagnostic
- A two-hundred-page client scan splits into the wrong number of documentsBoundary errors are wildly uneven across document types, so an overall accuracy figure hides them. Count documents in against documents out, per type, and fix the cause where the pages are produced.diagnostic
- Clients start the records upload and abandon it halfway throughA half-finished upload is a measurable event with a named drop point, not evidence that the client could not be bothered. Here is how to find which step killed the session.diagnostic
- A credit note is not a negative invoice: where the sign really livesModel it as an invoice with a minus in front and three things break: allocation, tax reporting, and every aging report that reads the ledger afterwards.definition
- Dates and amounts come out wrong, but only for one client's suppliersA locale fault cannot corrupt every document, which is exactly why it survives. Sample the ambiguous cases only, sliced by supplier, and the fault appears at once.diagnostic
- Line items extract cleanly but they do not sum to the invoice totalThe lines are right, the total is right, and the two disagree. Divide the difference by the subtotal before opening the document — the ratio usually identifies the fault on its own.diagnostic
Working on something in this space?
Tell us where you are in a sentence or two. We'll tell you honestly whether we're the right team, and what a sensible first slice of the work looks like.
Start the conversation