Originally posted by: waqar
Is there a way to print the html files to the network printer configured for the system.
Originally posted by: Yaron Shkop
The default printto verb for html files on windows is ofcourse IE.
IE6 however invoke a pop up dialog for the user during printto opperation. It's nice as long as the application is not a server one.. (no UI).
It took me a while to understand that this issue is a browser implementation and I was convinsed so after reading many posts about this in google discussion groups searches.
Most of the people by the way encountered the problem while developing FAX servers using MS FAX services (COM).
The solution is ofcourse to use other browser.
Netscape� Communicator 4.79 is the one that does the job silently as expected (NOT netscape 7.02...), it has to be set as the default browser on the machine.
If you don't want it to be the default browser set the Registry- html files printto only: (HKLM\Software\Classes\htmlfile\shell\printto\) to the values that netscape set them to when it's the default browser. (That way only the printto operation is done through netscape).
The other solution is to use MS-Word as I've already described in my previous post.
Reply
Originally posted by: Yaron Shkop
Sorry, but your solution doesn't solve the problem of print dialogs.
The idea was to prevent user dialogs from appearing for server based applications. (No UI!)
The solution is to edit the printto verb inside "Assaociated File Types" to a program that can do it without dialogs.
This is not a perfect solution since the program is MS-WORD.
If you have another software for coverting\printing html without dialogs please add a comment. (A freeware or a built in program in Windows!)
Action:
printto
Application used to ... :
"C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" /n /dde %1 %2
DDE Message:
[REM _DDE_Minimize][FileOpen("%1")][FilePrintSetup "%2 on p",.DoNotSetAsSysDefault=1][FilePrint 0][DocClose 2][FilePrintSetup ""]
Application:
WinWord
DDE Application not running:
[FileOpen("%1")][FilePrintSetup "%2 on p",.DoNotSetAsSysDefault=1][FilePrint 0][FileExit 2]
Topic:
System
Reply
Originally posted by: simon soosai
I am trying to send more than 1 files straight to the printer from my html page. How would i do that?
ReplyOriginally posted by: Kyselgov E.N.
1. Our program change settings.
In 6. our program must wait IE 6.0 hidden process completion but not main process completion!
This method does not work with IE 6.0.
This method based on registry IE settings changing.
It modify header and footer registry settings, run IE, wait for IE exit, and restore settings back.
!!! BUT !!! IE 6.0 (and maybe IE 5.5) prints in background (hidden) process. When you run IE 6.0 process for printing HTML page and if you will think that IE 6.0 process completion is signified printing completion than you will MISTAKEN.
Where is the error?
Look at process.
2. Our program runs IE 6.0 main process for printing.
3. IE 6.0 main process runs hidden printing process.
4. IE 6.0 main process exits.
5. IE 6.0 hidden process shows print dialog (waits OK).
6. Our program waits until IE 6.0 main process exits. <-- This is ERROR!
7. Our program restores settings.
8. IE 6.0 hidden process read settings (it's restored (not our) settings).
9. IE 6.0 hidden process prints.
10. IE 6.0 hidden process exits.
!!! BUT !!! There is not way for taking IE 6.0 hidden process handle.
Reply
Originally posted by: Kyselgov E.N.
Function C_PrintHtml::ExecIE() not close process handle - this is dangerous resource leak.
Add this code after WaitForSingleObject():
CloseHandle(sei.hProcess);
Reply
Originally posted by: Xig
C_PrintHtml::~C_PrintHtml()
otherwise, if you close your application while a doc is printing (or in print-setup for example) the app may crash and/or corrupt the registry!
Zig
There is a bug in the code. you need to add this to print_html.cpp:
{
WaitForSingleObject(printingResource, INFINITE);
}
Originally posted by: Fantom Code
I've been trying to figure this out. Thanks so much for this useful bit of code. You're on the top of my favorite people list as of now. HAH!
Thanks again,
Wow,
Fantom
Reply
Originally posted by: Piotr
I think this solution is good only for Administrator.
What about writing to Registry by user on NT/2000/XP?
Originally posted by: Erik Rydgren
If you have more then one instance of this class printing at the same time then you will probably loose the original settings for header and footer.