PdfAConverter
Static one-call API. File, stream, byte-array, or attachment input. Sync and async.
Converting existing PDFs to PDF/A is where archival projects usually
stall: fonts are not embedded, colours are device-dependent, the file
is encrypted, the metadata contradicts itself. LM-Kit ships
PdfAConverter: one call that repairs the document,
embeds and reconciles every font, calibrates colour through ICC
profiles, strips prohibited constructs, rebuilds XMP metadata, and
rewrites the result as PDF/A-1b, 2b, or 3b. Fully on-device.
PdfAConverterStatic one-call API. File, stream, byte-array, or attachment input. Sync and async.
Non-embedded fonts replaced by embedded equivalents with widths reconciled glyph by glyph. Layout never shifts.
Documents the rewrite cannot repair are rebuilt from page renders with an invisible text layer. Still searchable, always conforming.
The converter repairs the document in place before rewriting it, so text, vector graphics, and layout are preserved. Rasterization is a last resort, not the strategy.
Fonts
Every font is embedded. Missing programs are replaced by metric-compatible equivalents, declared widths are reconciled glyph by glyph, and encodings are normalized so extracted text stays intact.
Colour
Device colour spaces are calibrated through embedded ICC profiles and an sRGB output intent. Transparency is handled per conformance level.
Prohibited
JavaScript, launch actions, embedded multimedia, and external references are stripped, as the standard requires for self-contained archives.
Encryption
Pass the password and the converter opens protected sources. The output is always unencrypted; PDF/A forbids encryption.
Streams
LZW streams and non-conforming JPEG 2000 images are re-encoded to compliant equivalents without touching conforming content.
Metadata
PDF/A identification metadata is written and the XMP packet is synchronized with the document information dictionary, a classic validation failure.
Levels
Target the level your archive requests via PdfAConversionOptions.Level. The default is PDF/A-2b, the level most archives ask for.
Report
Every conversion returns a report: features detected, fixes applied, raster triggers, unresolved violations, page count, and whether encryption was removed.
Fallback
Rasterize (default) guarantees a conforming output by rebuilding unrepairable documents from page renders with an invisible text layer. Fail throws instead, ReportOnly ships the best-effort rewrite plus the violation list.
Server
The same converter ships in LM-Kit Server as POST /lmkit/v1/pdf-to-pdfa, with the conversion report mirrored in the JSON response.
One call converts a PDF to PDF/A-2b and returns a report of everything that was detected and repaired.
using LMKit.Document.Pdf; // One call: repair fonts and colour, strip prohibited constructs, // rebuild metadata, rewrite as PDF/A-2b. var report = PdfAConverter.ConvertToFile("invoice.pdf", "invoice_pdfa.pdf"); Console.WriteLine($"Conforms: {report.Conforms}"); Console.WriteLine($"Pages: {report.PageCount}"); Console.WriteLine($"Fixes applied: {report.FixesApplied}");
Target PDF/A-3b, open an encrypted source, and report residual violations instead of rasterizing.
using LMKit.Document.Pdf; // Target PDF/A-3b and report violations instead of rasterizing. var options = new PdfAConversionOptions { Level = PdfAConformanceLevel.PdfA3b, Fallback = PdfAConversionOptions.FallbackBehavior.ReportOnly, Password = "s3cret", // encrypted input; output is always unencrypted }; var report = await PdfAConverter.ConvertToFileAsync( "contract.pdf", "contract_pdfa.pdf", options); if (!report.Conforms) { Console.WriteLine($"Unresolved: {report.UnresolvedViolations}"); }
Bytes in, conforming bytes plus report out. Suited to web services and pipelines where documents never touch disk.
using LMKit.Document.Pdf; // Bytes in, conforming bytes plus report out. No temp files. byte[] source = await httpClient.GetByteArrayAsync(documentUrl); var result = await PdfAConverter.ConvertToBytesAsync(source); await blobStore.UploadAsync(result.Data); Console.WriteLine($"Raster fallback: {result.Report.UsedRasterFallback}");
A PDF/A claim only counts if an independent validator agrees. Across a large benchmark corpus of real-world PDFs, more than 99.5% of converted documents pass veraPDF conformance validation.
Merge, split, render, search-highlight, unlock, and inspect PDFs with the same library.
Coming from images instead of PDFs? ImageToSearchablePdf turns scans and multipage TIFFs into searchable PDF/A in one pass.
Markdown to PDF, HTML to Markdown, email to PDF, and the full conversion catalogue.
The invisible text layer used by the raster fallback is driven by the same on-device OCR engines.
Working console demos on GitHub, step-by-step how-to guides on the docs site, and the API reference for the classes used on this page.
Convert any PDF to PDF/A-1b / 2b / 3b with a full conversion report via PdfAConverter.
Open on GitHub → SampleStep-by-step doc page: prerequisites, setup, code path, expected output.
Read on docs → How-to guideConformance levels, fallback policies, encrypted sources, reading the report.
Read the guide → API referenceAPI reference for the PDF/A conversion entry point.
Open the reference →