HTMLPrint command line exit codes

Hello,

I am using HTMLPrint for an invoice printing solution which is in development. My company will shortly be purchasing a server license from you..

I would like to know, does htmlprint.exe have exit codes which indicate error conditions? If so, it would be helpful to know what the exit codes are and what error conditions they represent..

I am calling htmprint.exe from a C# application...

var startInfo = new ProcessStartInfo
{
CreateNoWindow = true,
FileName       = "htmlprint.exe",
Arguments      = "{my html doc} -hidewindow"
};

var process = Process.Start(startInfo);

process.WaitForExit();

switch (process.ExitCode)
{
case -1: // html print error?
case 0:  // html print success?
// etc...
}

I would be very grateful if you could clarify this point for me ?
=======================================
Thanks for your message, please refer to return value of htmlprint.exe at below,

0: Printing successful
-10: Can't load necessary DLL files properly
-101: Can't start spooler service
-10: Can't install virtual printer correctly
-11: Something is wrong in command line options
-12: Can't load device settings from target printer
-19: Wrong value in "Copies"
5: Trial version is expired
-21: Can't change printer settings

VeryPDF
=======================================
Thank you, the list was very helpful to me!

I have one further question – is it possible to give the input to htmlprint.exe via stdin instead of an HTML file or URL?

In my application I have HTML stored in memory as a string. Right now I have to create a temporary file on disk to print...

string myHtml = “<html> etc etc... </html>”;
var tempFile = File.WriteAllText(“temp.htm”, myHtml);
Process.Start(“htmlPrint.exe temp.htm”).WaitForExit();
File.Delete(tempFile);

I would prefer to pass the string to stdin like this:

var startInfo = new ProcessStartInfo(“htmlprint.exe”)
startInfo.RedirectStandardInput = true;
var process = Process.Start(startInfo);
process.StandardInput.WriteLine(myHtml);
process.WaitForExit();

And then no html file is necessary - Is it possible to do?
=============================
Thanks for your message, yes, read HTML content from “stdin” is a great solution, but the current version of HTMLPrint command line doesn’t support “stdin” yet, we will try to implement this function in the future, we will let you know after this function is available.

VeryPDF

Thank you XueHeng, the list was very helpful to me!

I have one further question – is it possible to give the input to htmlprint.exe via stdin instead of an HTML file or URL?

In my application I have HTML stored in memory as a string. Right now I have to create a temporary file on disk to print...

string myHtml = “<html> etc etc... </html>”;

var tempFile = File.WriteAllText(“temp.htm”, myHtml);

Process.Start(“htmlPrint.exe temp.htm”).WaitForExit();
File.Delete(tempFile);

I would prefer to pass the string to stdin like this:

var startInfo = new ProcessStartInfo(“htmlprint.exe”)

startInfo.RedirectStandardInput = true;
var process = Process.Start(startInfo);
process.StandardInput.WriteLine(myHtml);

process.WaitForExit();

And then no html file is necessary - Is it possible to do?

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

This entry was posted in HTML Print and tagged . Bookmark the permalink.

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!