Hello,
UPDATE: transformDocument includes the homeFolder option to set a custom home folder to be used for the conversions
Although your solution works perfectly, if you don't want to change the library, you can use this line:
putenv("HOME=/tmp");
to set a custom HOME folder before using the conversion plugin.
Regards.