pdfcpu / pdfcpu

A PDF processor written in Go.
http://pdfcpu.io/
Apache License 2.0
6.71k stars 460 forks source link

How to replace image in pdf? #455

Open lz1998 opened 2 years ago

lz1998 commented 2 years ago

I want to translate images in a pdf. After translation, the images will be the same size, but I don't know how to replace them.

hhrutter commented 2 years ago

I think this is something pdfcpu can provide as long as the image dimensions remain constant.

Maybe something like:

pdfcpu extract -mode image in.pdf .
...
writing img_#32.png
# alter image
...
pdfcpu image update #32 in.pdf in_#32.jpg
adamgreenhall commented 2 years ago

👍 I would also like to use this.