System will ONLY pass the last line from the command back through to the browser.
see http://www.php.net/manual/en/function.system.php
also $name will allow users to hurt your system when used with system, see escapeshellcmd() to make this safe.
passthru(escapeshellcmd("usr/bin/htmldoc -t pdf --webpage $name"));