The command to install anything from the AUR with pamac is build, not install — the latter is only for repo packages. Try…
pamac build pdftxt
And if you are using the Plasma desktop, okular can indeed also export a PDF to plain text, as @ajaychat3 says. I’m not sure what the default PDF viewer is in the other desktop environments, but it’s possible that they too have such a function built in.