Skip to content
Learn › Get data in › Extract from PDFs: open the docs menu

Write instructions for PDF table extraction

PDF extraction can depend on your plan · Updated 8 Nov 2026

The Custom option in PDF extraction imports exactly what you describe. In Review data import, under What to import, choose Custom and write your instruction in the text box. For the rest of the flow, see Extract tables from PDFs and images.

Use the Custom text box

The box shows the placeholder "Describe what to import from this PDF…". Under TRY:, click a suggestion to fill it: Convert all content into tables or Extract existing tables only. Extract stays disabled until you write an instruction, and Mammoth shows "Describe what to import first".

Good and vague instructions

ExampleWhy
Good"Extract the invoice number, vendor name, invoice date (MM/DD/YYYY), and total amount (numeric) from this invoice"Field names, data types and a clear scope
Good"Get all line items: product name, quantity, unit price, and line total"Matches the table structure in the document
Good"Extract only the summary table on page 1"Narrows the scope to avoid noise
Vague"Get the data"No field names, so the AI guesses what matters
Vague"Extract the table"Unclear when there are several tables
Vague"Get the numbers"No column names or context

Tips for a precise extraction

  • State expected data types: "total amount (numeric)", "date (MM/DD/YYYY format)".
  • Use the exact field names you want as column names.
  • Mention the page number if the data is on one page.
  • If the result isn't right, change what to import and extract again. You don't need to re-upload the file.

Example instructions by document type

DocumentInstruction
Invoices"Extract invoice number, vendor name, invoice date, due date, and total amount from this supplier invoice"
Reports"Extract the department name, report period, and all KPI values from this monthly performance report"
Forms"Extract applicant name, years of experience, current employer, and desired salary"
Bank statements"Extract statement date, beginning balance, ending balance, total deposits, and total withdrawals"
Contracts"Extract party names, effective date, contract value, and termination clause from this agreement"
Research tables"Extract all data from the results table on page 3, include the variable name, N, mean, and standard deviation columns"

Once an instruction works, Mammoth can replay it on the next file: see Read new PDFs the same way.

Was this page helpful?

Something wrong? support@mammoth.io