Command-line tool

gopdfrab convert

Rewrite a PDF as a PDF/A-1b conformant document, and find out what could not be fixed.

convert rewrites a single input. It applies pre-emptive fixups, then loops between verifying and repairing until the document converges, and rasterizes a page only as a last resort when no in-place fixer can repair it.

Flags

In addition to the shared flags, convert accepts:

Flag Value Description
--dpiintRaster fallback resolution. 0 uses the default of 150.
--max-iterationsintBound on the verify/fix loop. 0 uses the default of 4.
-opathOutput path. Defaults to the input with a .pdfa.pdf suffix, or .fixed.pdf for the pdf profile. A positional output argument works too.

--dpi only matters when a page has to be rasterized — it is the resolution that fallback renders at, and the trade is file size against legibility.

--max-iterations bounds the repair loop for pathological documents where fixing one problem keeps surfacing another.

What the report tells you

Alongside the result, convert reports what the conversion cost: a rasterized: line for pages rebuilt as an image, a dropped: line for each feature the rasterizer could not draw on them, and a lost: line for objects that could not be carried over. Under --json the same information is in rasterizedPages and rasterDrops.

Conformant is not the same as unchanged
A page whose content was lost during conversion still verifies clean, so read the rasterized and dropped lines rather than only the result. For archival work, check the output visually or use the library's fidelity comparison, which renders both sides and reports per-page differences.

For the equivalent in Go, with fidelity checking and batch streaming, see conversion in the library docs. To try a conversion without installing anything, use the browser converter.