How-to guides/Errors & Debugging
ValidationError::FontNotEmbedded
PDF/A-1b validation failed: font 'Arial' is not embedded

How to fix the PDF/A font embedding validation error

PDF/A requires that all fonts used in a document are fully embedded. If any font is referenced by name but not embedded, validation fails. This is one of the most common PDF/A conversion errors.

Why this happens

The document references a system font by name

The PDF contains text that uses a font installed on the system (like Arial or Times New Roman) but does not embed the font data. This is valid in regular PDF but not in PDF/A: the archive standard requires all fonts to be self-contained within the file.

Partial font embedding

Some tools embed only the glyph subset actually used in the document. If the subset table is missing required metadata (like the Widths array or BaseFont entries), PDF/A validators reject the font as insufficiently embedded.

Type1 font without required metrics

Type1 fonts require a FontDescriptor with specific metric entries (Ascent, Descent, CapHeight) to be PDF/A compliant. Older documents often omit these.

How to fix it

1

Embed fonts before converting to PDF/A

Call embed_fonts() on the document before running the PDF/A conversion. This scans all font references and embeds the data from your system font directories.

use pdfluent::{Document, PdfaLevel};

let mut doc = Document::open("report.pdf")?;

// Embed all referenced fonts
doc.embed_fonts()?;

// Now convert to PDF/A-1b
doc.convert_to_pdfa(PdfaLevel::A1b)?;

let report = doc.validate_pdfa(PdfaLevel::A1b)?;
println!("Valid: {}", report.is_valid());

doc.save("report_pdfa.pdf")?;
2

Use font subsetting to reduce file size while staying compliant

Embedding full fonts increases file size. Use subset embedding to include only the glyphs present in the document. PDFluent's embed_fonts_subset() produces a valid PDF/A-compliant subset.

use pdfluent::{Document, PdfaLevel, FontEmbedOptions};

let mut doc = Document::open("report.pdf")?;

doc.embed_fonts_with_options(FontEmbedOptions {
    subset: true,
    include_metrics: true,
})?;

doc.convert_to_pdfa(PdfaLevel::A2b)?;
doc.save("report_pdfa.pdf")?;
3

Use auto-embed during PDF/A conversion

Pass EmbedFonts::Auto to convert_to_pdfa_options(). This embeds all missing fonts in a single pass. Slower than pre-embedding but requires fewer steps.

use pdfluent::{Document, PdfaLevel, PdfaConvertOptions, EmbedFonts};

let mut doc = Document::open("report.pdf")?;

doc.convert_to_pdfa_options(PdfaLevel::A1b, PdfaConvertOptions {
    embed_fonts: EmbedFonts::Auto,
    ..Default::default()
})?;

doc.save("report_pdfa.pdf")?;

Frequently asked questions