Using token_replace in php filter with webform2pdf
When you use token_replace(), you need to provide it with a proper data array. Since you provide it with a node, your token replace can only replace [node:*] tokens (exceptions for global tokens such as [site:*]). If your submission is a node, you should be able to use [node:nid] instead.

If you were to use $sid = token_replace($sid_token, array('submission' =&gt; $node));, you can use tokens like [submission:*], but only with node properties (nid instead of sid).

If your submission is of another entity type, you will have to provide that as data as well.