gopdfrab convert
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 |
|---|---|---|
| --dpi | int | Raster fallback resolution. 0 uses the default of 150. |
| --max-iterations | int | Bound on the verify/fix loop. 0 uses the default of 4. |
| -o | path | Output 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.
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.