Couple of tangential questions:
Why did you choose "Header add" rather than the conventional "Header set"? Granted, the Link header (unlike some) can carry multiple values, but it still risks confusing the recipient. Is there any possibility that your site will be sending out other Link headers for other purposes?
What is the underlying purpose of the header? It seems to be saying, with
all pdfs, “The present URL is the canonical”. Are there any circumstances where your site would be sending out pdfs that are
not canonical, and if so, how would you prevent the header from being sent?
Coincidentally, there are a couple of recent ongoing threads pertaining to environmental variables. One conclusion gleaned from all of them is to use SetEnvIf whenever possible, and here it's definitely possible, using the syntax
SetEnvIf Request_URI etcetera
This can go inside the FilesMatch envelope, bypassing concerns about inheritance and execution order.
:: detour to check ::
OK, yes, it's called mod_headers, so it will execute after both mod_rewrite and mod_setenvif.