Print only Pdfs in a folder in Studio X

I have an output folder that contains multiple named records, each with a associated word and a pdf record(i.e. Jane Doe.Word, Jane Doe.pdf, John Smith.Word, John Smith.pdf). I need to print only the pdfs to a designated printer. I am using a For each Activity using the Filter By field as “*.pdf”. To execute the print should I use a While loop or is a If activity appropriate(If .pdf is true=execute)? Depending on your response, please advise on how to set up the activity appropriate. Thank you in advance.

@kcaller

In this scenario, using an “If” activity is appropriate. You don’t need a “While” loop because you’re not iterating through a dynamic condition; instead, you’re checking each file if it’s a PDF file and then printing it if it is.