Document forensics

schedule 11 min read

Document forensics is the examination of digital documents to determine whether they are authentic, altered, or entirely fabricated. As PDFs, contracts, certificates, and official records move increasingly to digital formats, the ability to detect forged or manipulated documents has become critical for legal professionals, compliance teams, and fraud investigators.

Document forensics analyzes file structure, metadata, font consistency, editing history, and digital signatures within PDFs, Word documents, and other digital file formats to detect tampering. Unlike traditional questioned document examination that focuses on handwriting and physical paper, digital document forensics examines the technical properties of electronic files to reveal whether content has been added, removed, or altered after the document's initial creation.

The problem is large and growing. The Association of Certified Fraud Examiners estimates that document fraud costs organizations over $3.5 billion annually in the United States alone. With generative AI now capable of producing convincing fake documents, including certificates, invoices, and legal filings, the tools for creating fraudulent documents have become dramatically more accessible while the techniques for detecting them have not kept pace.

This guide covers the technical methods used in digital document forensics, the specific artifacts that reveal manipulation in PDF and Office documents, and how forensic analysis integrates with digital signature verification and provenance checking.

$3.5B
Annual US document fraud cost
68%
Fraudulent docs detectable by metadata
PDF
Most commonly forged format
4.2x
YoY increase in AI-forged docs

PDF forensics

PDF is the most commonly examined format in document forensics for a simple reason: it is the most widely used format for official documents, contracts, certificates, and legal filings. The PDF specification, maintained by ISO as ISO 32000, defines a rich file structure that retains a surprising amount of forensic evidence about a document's history.

Understanding PDF structure

A PDF file is not a simple flat image of a page. It is a structured document containing objects, streams, fonts, images, and a cross-reference table that maps every element. This structure means that changes to a PDF are not invisible to forensic analysis, even when the visual output looks seamless.

The PDF format supports incremental updates, where changes are appended to the end of the file rather than rewriting the entire document. This means the original content often remains in the file even after modifications. A forensic examiner can parse the PDF's revision history to see the document as it appeared at each stage of editing, revealing content that was added, removed, or modified.

Every PDF also contains a metadata dictionary that records the creation application, the modification application, creation and modification timestamps, and in many cases the author name and organization. This metadata provides a starting point for forensic analysis, much like EXIF data in photographs.

Font analysis

Font analysis is one of the most powerful techniques in document forensics. When text is added to a PDF, the font used for that text is either embedded in the document or referenced from the system. Forensic analysis examines font consistency across the document, looking for sections where different fonts, font versions, or font rendering methods are used.

A common manipulation pattern is editing a scanned document by adding text overlay. The original scanned text has characteristics of a rasterized image: slight imperfections, consistent scan artifacts, and uniform resolution. Added text, rendered by a font engine, has mathematically precise curves, consistent stroke width, and resolution-independent rendering. The visual difference between scanned text and overlaid digital text is detectable both by trained examiners and by automated analysis.

Font embedding analysis

Checks whether fonts are consistently embedded throughout the document. A document created in a single session typically uses a consistent set of embedded fonts. Additional text added later may use different font embeddings or system font references.

Glyph metric comparison

Compares the exact metrics (width, height, spacing) of characters across the document. Even visually identical fonts from different sources have slightly different metrics that forensic analysis can detect.

Rendering method detection

Identifies whether text was rendered by a printer driver, a PDF creation library, or a PDF editor. Each rendering pipeline produces subtly different output that reveals the tool chain used.

Kerning and spacing analysis

Examines letter spacing patterns. Text from the original document follows consistent kerning rules. Inserted text may use different kerning values, creating micro-level spacing inconsistencies.

Edit history and revision analysis

PDF files that have been edited using standard tools often retain a complete revision history. Each time the document is saved after modification, a new revision is appended. The incremental update mechanism preserves previous versions within the same file.

Forensic analysis can extract these revisions to produce a timeline of changes. This is particularly valuable in legal contexts where the question is not just whether a document was altered but when and how. A contract that was modified after signing, with terms changed in the body while the signature page remained untouched, leaves evidence in the revision history even if the final visual output looks consistent.

warning

Some PDF editing tools offer a "save as optimized" or "linearized" option that rewrites the entire file and removes the incremental update history. If a document has been saved in this way, the revision history is lost. The use of optimization itself is a forensic indicator: legitimate documents rarely need to be optimized, while someone trying to hide editing history might.

Object stream analysis

Every element in a PDF (text, images, annotations, form fields) is stored as a numbered object in the file's object stream. Forensic analysis of the object stream can reveal anomalies that are invisible in the visual rendering. Objects that reference creation tools or timestamps inconsistent with the rest of the document indicate that they were added in a separate editing session.

Image objects within a PDF carry their own metadata, including resolution, color space, and compression method. An image inserted from an external source will have different compression characteristics than images that were part of the original document. This is a common finding in forged certificates where a legitimate template is used but the photograph or seal image has been swapped.

Office document forensics

Microsoft Office documents (DOCX, XLSX, PPTX) use the Open XML format, which is essentially a ZIP archive containing XML files, media assets, and metadata. This structure provides extensive forensic evidence about a document's creation and editing history.

DOCX analysis

Word documents store their content in XML that retains formatting metadata for every paragraph, run of text, and embedded object. The document properties XML records the author, last modifier, creation time, modification time, revision number, and total editing time.

One of the most forensically valuable features of DOCX files is the revision tracking system. Even when "Track Changes" is turned off, Word still increments the internal revision counter and records the editing duration. A document that claims to have been created in a single sitting but shows a revision count of 47 and total editing time of 3 minutes has likely been constructed from copied content rather than written from scratch.

The relationship files within the DOCX archive record links to external resources, embedded objects, and template files. These relationships can reveal that a document was based on a template from a different organization, that it contains objects copied from other documents, or that it references external content that would not be present in a legitimate document of its type.

Spreadsheet forensics

Excel files (XLSX) present unique forensic opportunities because spreadsheets contain formulas, cell references, and calculation chains that must be internally consistent. A fraudulent financial statement might show the right numbers in the visible cells but contain formulas that do not actually compute the displayed values. This discrepancy between formula logic and displayed values is a strong indicator of manipulation.

Excel also stores a "calculation chain" that records the order in which cells were last calculated. Manipulating individual cell values without updating dependent formulas creates inconsistencies in this chain that forensic analysis can detect.

Digital signature verification

Digital signatures provide the strongest form of document authentication available. A valid digital signature confirms that the document has not been altered since signing and that the signer possessed the private key associated with the signing certificate.

Forensic analysis of digital signatures involves verifying the certificate chain back to a trusted root certificate authority, checking the certificate's validity period and revocation status, and confirming that the document hash matches the signed hash. A signature that fails any of these checks does not necessarily indicate fraud (certificates expire, and documents can be legitimately modified), but it requires explanation.

Signature verification checks

Certificate chain: Does the signing certificate chain to a trusted root CA? Self-signed certificates provide no identity assurance.

Timestamp authority: Was the signature timestamped by a trusted TSA? Without a timestamp, the signature only proves the document existed when the certificate was valid, not when it was actually signed.

Document integrity: Does the document's current hash match the hash that was signed? Any modification after signing breaks this match.

Certificate status: Is the signing certificate still valid and not revoked? A revoked certificate may indicate that the signer's credentials were compromised.

AI-generated document detection

Generative AI has introduced a new category of document forgery. Large language models can produce convincing text for certificates, legal documents, and official communications. Image generation models can create realistic-looking seals, letterheads, and signatures. The combination allows the production of documents that appear legitimate at first glance.

Detecting AI-generated documents relies on a combination of content analysis and structural analysis. The text content may exhibit patterns characteristic of AI generation: lower perplexity, more uniform sentence structure, and factual errors or anachronisms that a human author would not make. The structural analysis examines whether the document was created through a legitimate workflow (word processor, document management system) or assembled from generated components.

Forensic metadata analysis is particularly effective against AI-generated documents because most generation workflows produce files with metadata profiles that differ significantly from documents created through normal business workflows. A PDF created by exporting from a web-based AI tool has a different producer string, creation tool, and internal structure than one created by Microsoft Word or Adobe Acrobat.

Forensic document analysis workflow

01
Structure
Analyze file format and objects
02
Metadata
Extract and verify all metadata
03
Font check
Analyze font consistency
04
History
Extract revision and edit trail
05
Signatures
Verify digital signatures

The workflow begins with structural analysis of the file format to understand what type of document is being examined and identify any immediate anomalies. Metadata extraction and verification follows. Font analysis and edit history examination provide the detailed forensic evidence. Digital signature verification, when signatures are present, provides either strong confirmation of authenticity or clear evidence of post-signing modification.

Applications

Document forensics plays a central role in legal proceedings involving disputed contracts, challenged wills, contested financial records, and questioned certifications. Courts accept forensic document analysis when it follows established methodologies and is conducted by qualified examiners. The analysis must be reproducible, and the findings must be documented in sufficient detail for opposing experts to evaluate.

Fraud investigation

Insurance fraud, procurement fraud, and financial statement fraud frequently involve manipulated documents. Forensic document analysis can detect altered invoices, fabricated receipts, modified bank statements, and forged authorization letters. The metadata trail often reveals when and how the manipulation occurred, providing evidence that supports or refutes fraud allegations.

Regulatory compliance

Compliance teams in financial services, healthcare, and government use document forensics to verify the authenticity of submitted credentials, licenses, and certifications. As regulatory bodies increasingly accept digital submissions, the need for automated document verification has grown. Forensic analysis can be integrated into compliance workflows to flag suspicious documents for human review.

Frequently asked questions

Can a PDF be edited without leaving any trace?

It is extremely difficult to edit a PDF without leaving any forensic trace. Even when the visual output looks perfect, the file structure, metadata, font data, and object stream retain evidence of modification. A sophisticated editor using specialized tools can eliminate some traces, but the combination of multiple forensic techniques makes completely undetectable editing rare. The more changes made, the more evidence is left behind.

How reliable is document forensics for court proceedings?

Document forensics is widely accepted in court proceedings globally. The analysis is based on objective, reproducible examination of file properties rather than subjective interpretation. Courts require that the methodology be sound, the tools be validated, and the examiner be qualified. When these standards are met, forensic document analysis provides strong evidentiary support.

Can AI-generated documents pass forensic analysis?

Current AI-generated documents typically fail forensic analysis because their metadata profiles, file structures, and creation workflows differ from legitimate documents. However, the gap is narrowing. A sophisticated forger who generates text with AI, then carefully recreates the document using legitimate tools (creating it in Word, printing to PDF through a normal workflow) can produce a file that is structurally indistinguishable from a legitimate document. Content analysis and external verification then become the primary detection methods.

What is the difference between digital document forensics and questioned document examination?

Traditional questioned document examination (QDE) focuses on physical documents: handwriting analysis, ink chemical analysis, paper fiber analysis, and indented writing detection. Digital document forensics examines electronic files: metadata, file structure, font analysis, and digital signatures. The two disciplines are complementary, and cases involving scanned physical documents may require both approaches.

Does encrypting a PDF affect forensic analysis?

PDF encryption protects the content from unauthorized viewing but does not prevent forensic analysis by authorized examiners who have the password. The encryption itself provides forensic information: the encryption method, key length, and permissions set reveal the tool used to encrypt and the creator's intent. An encrypted document that has been decrypted, modified, and re-encrypted may show evidence of the modification in the encryption metadata and file structure.

Verify document authenticity with AFIP

Upload a document for comprehensive forensic analysis including metadata, structure, and signature verification.

Run forensic analysis