Delete non-corresponding files

Any Ideas how to solve the following problem?
I have two folders with corresponding files. The one folder has .png the other one .pdf with the same name. Now I want to compare both folders and delete the file if there is no corresponding file.
Example:
Now I want c.pdf deleted, since there is no corresponding file.
Would appreciate any help.
PS: for those who are interested. I convert all my screenshots with some amazing hazel rules into searchable PDFs in a subfolder. But some screenshots are nonsense. If I delete them, I want the corresponding PDF deleted.
I have two folders with corresponding files. The one folder has .png the other one .pdf with the same name. Now I want to compare both folders and delete the file if there is no corresponding file.
Example:
- Code: Select all
Folder PNG
a.png
b.png
d.png
- Code: Select all
Folder PDF
a.pdf
b.pdf
c.pdf
d.pdf
Now I want c.pdf deleted, since there is no corresponding file.
Would appreciate any help.
PS: for those who are interested. I convert all my screenshots with some amazing hazel rules into searchable PDFs in a subfolder. But some screenshots are nonsense. If I delete them, I want the corresponding PDF deleted.