Permission problem when call htmltools from C#, or exe

Hi Very PDF,

We do not have a problem running from the command line; however certain parameters do not work when run from a exe.

We change an htm file to a pdf file as follows:

The following did not work from the exe

* Dim htmltool As Process = Process.Start("htmltools.exe",
"-pageheight 1050 -margin 100x140x100x140 " & htmFileName & " " &

The return value was -4 (Can't locate specify printer in this computer)

The following did work from the exe:

* Dim htmltool As Process = Process.Start("htmltools.exe", "-htm2pdf2
" & htmFileName & " " & pdfFileName)

Both commands work from the command line.

Can you help?


This problem is caused by permission limitation in SYSTEM user account, please arrange your C# code run inside an administrator user account instead of default SYSTEM user account, this problem will be solved.
Please refer to following web pages for more information,


VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Verify Code   If you cannot see the CheckCode image,please refresh the page again!