Can I identify an image within PDF more easily instead of with object number?

Hi there

As you see the attached file, I have a huge number of images, and I want a specific image to be replaced.

I understand using Swap of PDFTron allows for replacing images.

However, I would like to know how to identify or locate an image that is needed to be replaced so that there is no need for complicated process.

I already know Image Type and Object Number are to identify images within PDF.

But as they are created during the creation of PDF, I have to eventually extract images as object number at once and then replace object number in order to replace a specific image.

I would like to know if there is more convenient way to replace an image - for example, it seems better if I can assign a name for every image as I want when PDF is created.

Thank you.

Best Regards,

ImageReplacer.png

If you are creating the PDF, then you can add your own metadata to the image xobjects. See the following on how to add a custom key/value pair to XObject.

http://www.pdftron.com/pdfnet/intro.html#sdf_obj

In particular

`

// given image is a pdftron.PDF.Image object

image.GetSDFObj().PutName(“MyCustomKey”, “ImageGUID”);

`

Then to retrieve

Obj o = image.FindObj("MyCustomKey"); if(o != null) { string val = o.GetAsPDFText(); }