I believe I have found the issue, at least with my particular problem.
When sc generates the source for a grid, it generates a file called <appname>.php. If you do a search through that file for “$arq_pdf_in” you will find a line that looks like this:
$arq_pdf_in = (FALSE !== strpos($nm_url_de_saida, ' ')) ? " \"" . $nm_url_de_saida . "\"" : $nm_url_de_saida;
Now, I believe that the wrong variable is being used. $nm_url_de_saida contains the URL to the HTML file to be used as input to wkhtmltopdf. On my server this generates an error. If I change all 3 instances of “$nm_url_de_saida” to “$nm_arquivo_de_saida”, which represents the absolute server path to the same HTML file, then everything works fine.
The only problem is of course when I generate source again, the bug is reintroduced.
Can anyone tell me where the template is stored that is used by sc to generate the grid source file? It would be excellent to change it there rather than waiting for a sc update.