By Jetformat
A document batch pipeline is an ordered process for validating inputs, creating derivatives, and checking results across multiple files. Each job needs its own input identity, output path, and outcome so an old file cannot be mistaken for a new successful conversion.
Preflight before conversion
Validate each input and inspect its structure before scheduling writes. Validation checks file structure; inspection supplies format-specific information such as visible worksheets or slide counts.
jetformat validate report.docx
jetformat word inspect report.docx --json
A valid package can still contain unsupported content or unavailable fonts. Keep those checks in the acceptance criteria instead of interpreting a successful validation as a promise of visual fidelity.
Write to a distinct output path
jetformat word to-pdf report.docx -o report-output.pdf
Use a job-specific output directory in a real batch. Decide explicitly whether reruns may overwrite prior outputs. The CLI’s --force option should follow that decision rather than being added to every example by habit.
In shell automation, inspect the exit status before proceeding. Do not announce an output merely because the expected filename can be constructed: an older file at the same path can survive a failed run and mislead downstream steps.
Verify both structure and appearance
jetformat pdf info report-output.pdf --json
jetformat pdf render report-output.pdf --pages 1 --width 1600 -o report-preview
Compare page counts with expectations and review representative pages, especially around tables, page breaks, or font changes. Reading metadata is free, while rendering previews uses page-based credits.
When an error occurs, retain enough information to reproduce the input type, command, version, and failure without logging private document contents. See unsupported files, font checks, and billing behavior.
Define the states a job can reach
| State | Evidence | Next action |
|---|---|---|
| Input rejected | Validation or supported-format check fails | Correct the source or record the unsupported requirement |
| Write failed | Command exits nonzero | Preserve the error and investigate before retrying |
| Written, not reviewed | New output exists and is readable | Run the required content and visual checks |
| Accepted | Required checks passed | Publish the reviewed derivative |
The states distinguish process success from content acceptance. A job can write a valid PDF while omitting an unsupported chart. Treating every zero exit as accepted would hide that distinction.
Process one job in order
- Assign a unique job directory and record the source revision or file identity.
- Validate and inspect the input before scheduling metered writes.
- Run conversion and stop dependent commands on failure.
- Inspect the new output’s page count and relevant text.
- Generate and inspect the previews required by the acceptance criteria.
- Record acceptance separately from conversion success before exposing the output to downstream users.
A shell wrapper can enforce failure ordering with an if statement or &&; do not separate dependent commands with unconditional execution. Choose an explicit overwrite policy before retrying a job that already has output files.
Estimate and reconcile usage
An illustrative batch of 10 documents producing 6 pages each uses 60 conversion credits. Rendering 2 previews per document adds 20 credits, for 80 credits total. Free validation and inspection add no credits. Failed writes are not charged, but successful reruns are separate operations.
Record estimates and observed page counts separately. If a result is unexpectedly short, inspect it for missing content instead of treating lower usage as success. If it is longer, check pagination before adjusting the next batch estimate. Keep diagnostic logs useful without copying private document contents or credentials into them.