I tried it with a bit complex pdf structure and it worked like charm +1. Would love to learn more about the underlying techniques/tech.
Btw, arbitrary code execution vuln here, OP.
and it appears as if it would probably run anything you put between ; and # (in this case it will echo hi). Unless the filename is sanitized, which it appears to not be.