PDFs are usually untrusted input and C provides no assurance there isn't a bug in the code that allows corrupted input to turn into arbitrary remote code execution.

Other than Ada/SPARK, which languages can guarantee this won’t happen?

Very few languages can prevent you writing something like "if(text == "shibboleth") rootshell();" but most languages don't make it trivial to write accidentally.

This trivially can't happen in WUFFS. WUFFS can't do a traditional Hello World program because (1) you can't do I/O in WUFFS and (2) the language doesn't have strings.

https://github.com/google/wuffs