Action on pages of a document triggered by contained text

I need to print a pdf document containing invoices including payslips. Payslips need another paper as the rest of the invoice. Preferred solution: something like “print document; if page contains ‘xxx’ then take paper1, else take paper2”.

If that’s not possible: Scan document, check if page contains xxx then add to file1 else add to file2.
Is that possible with pdfcreator? I did not find an answer in the user guide. Thanks fpr any hints.