Action to find missing QR Code (1-bit image)

Post Reply
BeCa
Newbie
Posts: 6
Joined: Wed Jun 07, 2023 5:00 pm

Action to find missing QR Code (1-bit image)

Post by BeCa »

Hello All,

Many of the PDFs we process have a QR code in the last page to direct the readers to different web site pages. I'm trying to include in my action list a step that would give a message when the QR code is present and an error when the QR code is missing.

It is fairly simple to make an action that would give a message if the QR Code is present of the page, but I'm struggling to find an action to give me an error message if the QR code is missing.

A nice thing about the QR codes that we use is that they are 1-bit images, it is normally the only image in the whole PDF that is of that type.

I've been using the "check if visual content exists" action to try to accomplish my goal and that action would be perfect if instead of having to provide a sample of the visual content that I'm looking I could simple say "any 1-bit image on the page", but that seems to be not possible with that action.

I've also tried to use one QR-code as the sample, and it works, but only with that specific QR-code, when the QR-code is slightly different, the action does not detect it anymore.

I hope my explanation is clear.

Could you please help me to find an action that could do this?

Thank you!
freddyp
Advanced member
Posts: 1023
Joined: Thu Feb 09, 2012 3:53 pm

Re: Action to find missing QR Code (1-bit image)

Post by freddyp »

If it is the only 1-bit image in the file and it is on the last page, then the solution is:
Select pages (last)
Select image type (1-bit)
AND
Log selection

And the "trick" is that "Log selection" allow you to log a message when nothing is selected, which in this case means that the QR code is missing.
BeCa
Newbie
Posts: 6
Joined: Wed Jun 07, 2023 5:00 pm

Re: Action to find missing QR Code (1-bit image)

Post by BeCa »

Fantastic! It worked.

Thank you very much!
Post Reply