Skip to main content
Guides·8 min read·

How to Extract Material Specifications from a PDF Certificate

Quick Answer

Quick Answer

To extract material specifications from a PDF certificate: for one-off lookups, use PDF text selection or copy-paste. For recurring extraction at volume, use an AI extraction tool that maps chemistry, mechanical properties, heat number, and standard references to a structured schema. Native PDFs yield better accuracy than scanned ones.

A PDF mill test certificate contains the complete material specification evidence for a heat of material: chemical composition, mechanical test results, the standard and grade it was tested against, and the certifying mill's statement. Getting those values out of the PDF and into a usable system—without manual re-typing—is the practical challenge this guide addresses.


Understanding What Is in a Material Spec PDF

Before extracting, know what you are looking for. A typical MTC contains:

Header / identity fields

  • Heat number (sometimes called cast number, melt number, or lot number)
  • Certificate number and date
  • Order / PO reference
  • Certifying mill name and address
  • Signatory and title

Material specification fields

  • Applicable standard (e.g., ASTM A106, EN 10210-1, API 5L)
  • Grade (e.g., Grade B, S355J2H, X52)
  • Product form (seamless pipe, hot-rolled plate, bar)
  • Nominal dimensions (OD, wall thickness, length)
  • Heat treatment condition (normalized, quenched and tempered, as-rolled)

Chemical composition table

  • Carbon (C), Manganese (Mn), Silicon (Si), Phosphorus (P), Sulfur (S) at minimum
  • Additional elements depending on grade: Chromium, Molybdenum, Nickel, Vanadium, Niobium, Boron, Nitrogen, etc.
  • Values typically reported as weight percentage to 2–4 decimal places

Mechanical test results

  • Tensile strength (UTS), yield strength (YS/Rp0.2), elongation (%)
  • For impact-tested grades: Charpy absorbed energy (Joules) at specified temperature
  • Hardness (HB, HV, HRC) where applicable

Supplementary data (where applicable)

  • Non-destructive examination results
  • Weld wire / filler metal data (for welded products)
  • Post-weld heat treatment records
  • Hydrostatic test results

Method 1: Manual Copy-Paste (Single Documents)

For occasional, low-volume lookups:

  1. Open the PDF in any PDF reader
  2. For native PDFs (machine-generated): use the text selection tool to highlight and copy values directly. Note: tables may not copy cleanly—values may arrive in the wrong order depending on how the PDF was generated.
  3. For scanned PDFs: the text layer is an image, not selectable text. You must read values visually and type them.

Limitations: Slow, error-prone for chemistry tables, no structured output, no audit trail.


Method 2: PDF Text Extraction with Python (Programmatic, Native PDFs)

For developers who need to process a batch of native PDFs programmatically:

import pdfplumber

with pdfplumber.open("milling_cert.pdf") as pdf:
    for page in pdf.pages:
        # Extract all text
        text = page.extract_text()
        
        # Extract tables as lists
        tables = page.extract_tables()
        for table in tables:
            for row in table:
                print(row)

What this gives you: Raw text and table arrays from a native PDF. You still need post-processing logic to identify which table is the chemistry table, which row is the header, and how to associate values with element labels.

Limitations:

  • Only works for native PDFs (not scanned)
  • Table structure is lost for complex layouts (merged cells, multi-row headers)
  • No field identification—you must write rules to find each value
  • Does not handle layout variation across different mills

This approach is viable for a single-supplier, high-volume scenario with a stable PDF format. It is not a general-purpose certificate parser.


Method 3: AI-Based Extraction (General Purpose)

For production use across multiple suppliers and document types:

An AI extraction tool receives the PDF, classifies the document type, identifies the applicable extraction schema, extracts values with per-field confidence scores, and returns a structured JSON record. The process is the same for native PDFs and scanned documents, though accuracy is higher for native PDFs.

What the output looks like (simplified):

{
  "heat_number": "A87234",
  "applicable_standard": "ASTM A106",
  "grade": "Grade B",
  "chemical_composition": {
    "carbon": { "value": 0.18, "unit": "wt%", "confidence": 0.97 },
    "manganese": { "value": 1.06, "unit": "wt%", "confidence": 0.96 },
    "phosphorus": { "value": 0.012, "unit": "wt%", "confidence": 0.94 },
    "sulfur": { "value": 0.008, "unit": "wt%", "confidence": 0.95 }
  },
  "mechanical_properties": {
    "tensile_strength": { "value": 415, "unit": "MPa", "confidence": 0.98 },
    "yield_strength": { "value": 240, "unit": "MPa", "confidence": 0.97 },
    "elongation": { "value": 28.5, "unit": "%", "confidence": 0.95 }
  }
}

Each field carries its value, unit, and confidence score. Low-confidence fields are routed to human review.


Common Extraction Challenges by Field Type

Heat numbers: Format varies widely—some mills use purely numeric codes, others use alphanumeric combinations with hyphens, others include lot or test piece references. Extractors must handle format variability without truncating or transposing characters.

Units: Mechanical properties may be reported in MPa, N/mm², ksi, or tf/in² depending on the mill's country and the applicable standard. Unit detection and normalization is required for cross-certificate comparison. A tensile strength of "60 ksi" and "414 MPa" are equivalent but will appear different without unit-aware normalization.

Chemistry values near detection limits: Some mills report elements as "<0.005" (less than the detection limit) rather than a specific value. The extractor must handle this as a bounded value, not a text string or a null.

Dual certification: A certificate covering two simultaneous standards (e.g., ASTM A106 Gr.B / ASME SA-106 Gr.B) must record both references. Single-standard extractors drop the second reference silently.

Product dimension tables: For pipe certificates, a dimensions table listing OD, wall thickness, and length by item number is common. This table must be parsed separately from the chemistry and mechanical data and linked by item number.


After Extraction: Validation Against the Specification

Extracted values are only useful if you know whether they conform. Validation requires comparing each extracted value against the applicable standard's limits:

FieldExtracted valueStandard limitResult
Carbon0.18 wt%≤ 0.30 wt%Pass
Tensile strength415 MPa≥ 415 MPaPass (at minimum)
Yield strength240 MPa≥ 240 MPaPass (at minimum)
Elongation28.5%≥ 30%Fail

Without a stored, versioned standards database, this validation requires the reviewer to look up limits manually—negating much of the automation benefit. Platforms like TestCert integrate extracted values with a standards validation engine at extraction time, so pass/fail is determined automatically for every extracted field.


FAQs

Why does copying text from a certificate PDF give me garbled results?

Two common causes: (1) The PDF uses an embedded font with non-standard character encoding, causing copy-paste to substitute incorrect Unicode characters. (2) The chemistry table was created as an image rather than selectable text. In case 1, a PDF library that handles encoding correctly will produce better results than simple copy-paste. In case 2, OCR or AI extraction is required.

How do I tell whether a PDF has a text layer or is purely a scanned image?

Try to select text on the page. If you can highlight individual words, the PDF has a text layer. If selection highlights the entire page or nothing, it is an image-only PDF. In Python, pdfplumber or PyMuPDF will return an empty or very short text string for image-only pages, which you can use as a programmatic detection heuristic.

Can I extract material specs from a certificate that is embedded in a larger document package?

Yes, but requires a document segmentation step first. Project documentation packages often bundle MTCs, inspection reports, and packing lists into a single PDF. The extractor must identify which pages belong to which document type before applying the appropriate extraction schema to each section.

What is the best way to extract chemistry from a certificate with a non-standard table layout?

For unusual layouts—two tables split across the page, rotated tables, or tables with non-standard headers—a vision-language model outperforms OCR-based approaches because it interprets layout visually rather than relying on text structure. If you are using a rule-based or OCR-based tool, you will need to add a custom template for that mill's layout.

How should I handle a certificate where mechanical results are reported in a different unit than my database expects?

Implement unit normalization at the extraction layer, not the database layer. Store a canonical unit (MPa for strength, % for elongation) and convert at extraction time using the unit detected from the certificate. Record both the original value and unit alongside the normalized value in the audit trail, so the conversion is traceable.

Ready to automate your certificate workflow?

Try TestCert free

Related Guides