Yes, Pennsylvania taxes dividends and capital gains.
Additionally, you should know that even if you leave your dividends and capital gains in the account to be re-invested that that is still money you made. Re-investing the money is just how you spent it.