Preflight izvješća

Usklađenost, Pregled dokumenta, Automatizacija

Pregled

PDFlibPas can run its built-in PDF/A and PDF/UA-1 file-compliance checks against an external PDF and turn the result into reusable report output. Use the report APIs when an application or build pipeline needs the same diagnostics as CheckFileUsklađenost, but does not want to manage string-list handles directly.

The report pipeline is intentionally layered. CheckFileUsklađenost remains the low-level API that returns issue-list handles. CreatePreflightReport formats the selected checks into a stable plain-text body. CreatePreflightReportEx converts that same text report to text, JSON, HTML, or CSV so all formats share the same pass/fail status and issue count.

API-jevi biblioteke

CheckFileUsklađenostPokreće jednu odabranu provjeru usklađenosti nad PDF datotekom i vraća 0 za prolaz ili StringListID koji sadrži retke problema.
CreatePreflightReportPokreće provjere PDF/A, PDF/UA-1 ili obje i vraća običnotekstualno izvješće sa zaglavnim metapodacima, jednim odjeljkom po provjeri i završnim sažetkom.
CreatePreflightReportExPovratne vrijednosti the same report in text (0), JSON (1), HTML (2), or CSV (3) format. Unknown format values fall back to text.
SavePreflightReportZapisuje običnotekstualno izvješće kao UTF-8 i po potrebi stvara nadređeni direktorij.
SavePreflightReportExZapisuje tekstualno, JSON, HTML ili CSV izvješće kao UTF-8 i po potrebi stvara nadređeni direktorij.
ComparePreflightReportsUspoređuje dva običnotekstualna izvješća, zanemaruje promjenjive retke vremenske oznake Generated: i vraća sažeti diff samo kada se promijenio stabilni sadržaj.

Ugovor formata

TextThe canonical report body. It contains Generated, Input, Checks, Issue mode, one section for each selected check, and a Summary block with Total issues and Result.
JSONA single object with title, generated, input, checks, issueMode, sections, and summary. Each section has a name, status, and issue-string array.
HTMLA standalone UTF-8 HTML document. The text report is HTML-escaped and displayed inside a preformatted block, so report content is visible without being interpreted as markup.
CSVRows use the fixed columns kind,section,status,code,message. meta rows carry header fields, check rows carry PASS/FAIL section status, issue rows split numeric issue codes from messages, and summary rows carry the final totals.

Odabir usklađenosti

The report APIs use a bit mask for UsklađenostTests: 1 selects PDF/A, 2 selects PDF/UA-1, and 3 selects both. Passing 0 also runs both checks. Options currently uses bit 1 to stop each selected check after its first issue; pass 0 to collect all reported issues.

Demo iz naredbenog retka

Delphi konzolni demo PreflightReport prikazuje tijek rada s izvješćima bez dodavanja UI-ja specifičnog za aplikaciju. Može provjeriti jedan PDF, generirati oblikovani izlaz, usporediti novo tekstualno izvješće s osnovnom verzijom ili skupno obraditi direktorij.

PreflightReport.exe --input "C:\PDFs\invoice.pdf" --output "C:\Reports\invoice.preflight.txt"
PreflightReport.exe --input "C:\PDFs\invoice.pdf" --output "C:\Reports\invoice.preflight.json" --json
PreflightReport.exe --input "C:\PDFs\invoice.pdf" --output "C:\Reports\invoice.preflight.csv" --format csv
PreflightReport.exe --input "C:\PDFs\invoice.pdf" --output "C:\Reports\invoice.preflight.txt" --compare "C:\Baselines\invoice.preflight.txt"
PreflightReport.exe --input-dir "C:\PDFs" --output-dir "C:\Reports" --recursive --format html

Način za jednu datoteku vraća izlazni kod 0 kada odabrane provjere ne prijave probleme, 1 za pogreške naredbenog retka ili izvođenja i 2 kada je prijavljen bilo kakav problem ili se osnovna usporedba razlikuje. Način direktorija zapisuje jednu datoteku <basename>.preflight.<ext> po PDF-u i dodaje datoteku preflight-summary.csv s izvornom putanjom, statusom prolaz/neuspjeh, brojem problema i putanjom izvješća.

Napomene o usporedbi

ComparePreflightReports definiran je za običnotekstualna izvješća. Treba mu dati osnovno tekstualno izvješće i novogenerirano tekstualno izvješće, čak i kada je izlaz za isti pokret JSON, HTML ili CSV. Uspoređivač normalizira retke Generated: jer se vremenske oznake mijenjaju pri svakom pokretanju; svi drugi stabilni retci uspoređuju se redom uz mali prozor gledanja unaprijed kako bi se diffovi umetanja i brisanja lakše čitali.

Vidi također

CheckFileUsklađenost, CreatePreflightReport, CreatePreflightReportEx, SavePreflightReport, SavePreflightReportEx, ComparePreflightReports, GetPDFUADiagnostics

CheckFileCompliance