import_images
Import edited images from a directory using a JSON manifest
Usage
pdftl
<input>import_images<dir>[manifest=<manifest.json>][quality=<q>]output<out.pdf>
Details
The import_images operation reads a JSON manifest (generated by export_images) and
overwrites the corresponding internal PDF image streams with the edited files from a
directory.
If an image file in the directory has not been modified (its MD5 hash matches the original export hash), it is safely skipped to prevent unnecessary re-encoding and generation loss.
Arguments
<directory>: (Required) The directory containing the edited images.[manifest=<manifest.json>]: Path to the JSON manifest. If omitted, defaults to<directory>/manifest.json. Specifymanifest=-to read the manifest from standard input.[quality=<q>]: The JPEG compression quality (1-100) used when writing back lossy images. (Default: 75)
Examples
Import edited images from ‘my_images/’ using ‘my_images/manifest.json’ and save.
pdftl in.pdf import_images my_images output out.pdf
Import edited images using a custom manifest location.
pdftl in.pdf import_images edited_assets manifest=custom_manifest.json output out.pdf
Tags: in_place, images, import, replace
Source: pdftl.operations.export_import_images
Read online: https://pdftl.readthedocs.io/en/latest/operations/import_images.html
Type: Operation