Select the repeated object in each page by Javascript or any workaround?

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

Post Reply
OngICITi
User
Posts: 4
Joined: Wed Jul 28, 2021 2:20 pm

Select the repeated object in each page by Javascript or any workaround?

Post by OngICITi »

Hi there,

I have a image object on the each page repeatably, its width and height(let say 400*200) is the same in each page....
Any way to select all of them in a simple way? The file has 700 pages, I don't want to do it one by one. Please help.

P.S. That is not watermark, coz I cant remove it by watermark methed.
P.SS. It can't be handled by redaction tool, coz there are many layer above it.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19788
Joined: Mon Jan 12, 2009 8:07 am
Contact:

Re: Select the repeated object in each page by Javascript or any workaround?

Post by Stefan - PDF-XChange »

Hello OngICITi,

Are those copies of the same image (e.g. a logo that has been duplicated multiple times over your file)?
Also - even if there are other objects that might overlap that same area - from your description it seems like you want that particular image removed - so would the other objects that are in the same part of the page relevant and are they absolutely necessary to be preserved?

Can you share a sample PDF with us (just a few pages should be enough)?

Kind regards,
Stefan
User avatar
Paul - PDF-XChange
Site Admin
Posts: 7356
Joined: Wed Mar 25, 2009 10:37 pm
Contact:

Re: Select the repeated object in each page by Javascript or any workaround?

Post by Paul - PDF-XChange »

Hi Ongi

it depends what you want to do with the image. If you want to replace all instances of a referenced image we have a tool for that. With one of the images selected you should see the dynamic "Format" and "Arrange" tabs appear. On the format tab are some image tools, including the replace tool:
image.png
Alternatively you can use the "Content Pane" to select all images
selectAllImages.gif
Does that help?
Best regards

Paul O'Rorke
PDF-XChange Support
http://www.pdf-xchange.com
OngICITi
User
Posts: 4
Joined: Wed Jul 28, 2021 2:20 pm

Re: Select the repeated object in each page by Javascript or any workaround?

Post by OngICITi »

Tracker Supp-Stefan wrote: Wed Jul 28, 2021 2:42 pm Hello OngICITi,

Are those copies of the same image (e.g. a logo that has been duplicated multiple times over your file)?
Also - even if there are other objects that might overlap that same area - from your description it seems like you want that particular image removed - so would the other objects that are in the same part of the page relevant and are they absolutely necessary to be preserved?

Can you share a sample PDF with us (just a few pages should be enough)?

Kind regards,
Stefan
Hi Stefan,

I upload one sample pdf here.
https://file.io/QWnZ96jNbsBL

This is the repeated image on each page... there are other image and the actual pdf is 700 pages+...
Image
OngICITi
User
Posts: 4
Joined: Wed Jul 28, 2021 2:20 pm

Re: Select the repeated object in each page by Javascript or any workaround?

Post by OngICITi »

Paul - Tracker Supp wrote: Wed Jul 28, 2021 2:46 pm Hi Ongi

it depends what you want to do with the image. If you want to replace all instances of a referenced image we have a tool for that. With one of the images selected you should see the dynamic "Format" and "Arrange" tabs appear. On the format tab are some image tools, including the replace tool:

image.png

Alternatively you can use the "Content Pane" to select all images

selectAllImages.gif

Does that help?
The replace tool work in my sample pdf, but not the actual pdf... I don know why but that is helpless....

The second method is also not working since there are other thousand pictures which I dont need delete them.

Anyway, thanks for the reply.
OngICITi
User
Posts: 4
Joined: Wed Jul 28, 2021 2:20 pm

Re: Select the repeated object in each page by Javascript or any workaround?

Post by OngICITi »

Is there any way to select the object by width/height, position or color? :oops: :oops: :oops:
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19788
Joined: Mon Jan 12, 2009 8:07 am
Contact:

Re: Select the repeated object in each page by Javascript or any workaround?

Post by Stefan - PDF-XChange »

Hello OngICITi,

There is an option to select all instances of an object. In your case - you can open the contents pane, and locate the image that is on the first page, then select to replace all instances of that same image with e.g. a 1x1px transparent PNG image which will effectively "remove" the original from the file, and the replacement (being transparent) will not interfere with the contents below it:
image.png
I didn't have such a transparent image at hand, but I tried replacing the original in your file with a picture I had on my desktop - and it did work, and replaced it on all pages.

Kind regards,
Stefan
joxeme
User
Posts: 55
Joined: Wed Jul 31, 2024 5:10 am

Re: Select the repeated object in each page by Javascript or any workaround?

Post by joxeme »

Hi,

This works but not 100%, thus; i merged a 8 pdf into 1 pdf, i have to do this operation 8 times, when changing at the begining it does not change more than first pdf, even the image is the same (i guess, since Properties does not give id or name).

Is there any Javascript method?

Thank you,
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19788
Joined: Mon Jan 12, 2009 8:07 am
Contact:

Re: Select the repeated object in each page by Javascript or any workaround?

Post by Stefan - PDF-XChange »

Hello joxeme,

The "select all instances" will work when the same image object is repeated 8 times on 8 separate pages.
If you merge 8 documents into one - even if the image is visually the same - each page came with it's own copy of an image file and the Editor (or any other tool) will see those as 8 separate images, and no way to recognize that they are the same virually.

If they are located in the same coordinates - you can try to redact out that area of your pages, but that will remove more than just the image itself, so might again not be ideal.

Kind regards,
Stefan
joxeme
User
Posts: 55
Joined: Wed Jul 31, 2024 5:10 am

Re: Select the repeated object in each page by Javascript or any workaround?

Post by joxeme »

Ok that makes sense.

How can i "redact out that area of the pages"?? :roll:

Thank you,
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19788
Joined: Mon Jan 12, 2009 8:07 am
Contact:

Re: Select the repeated object in each page by Javascript or any workaround?

Post by Stefan - PDF-XChange »

Hello joxeme,

Please take a look here on how to use redaction in general:
How to use Redaction

And this page while speaking of "page numbers" is effectively showing you how to apply a redaction to the same position of all pages in a file:
Can I use PDF-XChange Editor to add/remove page numbering?

Kind regards,
Stefan
Post Reply