matrix_aash
asked on
Printing HTML files in VB.NET
Hi,
I want to be able to print an HTML file from a location (for this example we will say "C:\test.html"). I want to be able to set the printer settings such as orientation, margins etc and if i can, choose what printer it comes out on. I have tried playing around with the printer control but cannot seem to work it out.
Also if possible, if there a way you can track the progress of the print?
Thanks in advance!
I want to be able to print an HTML file from a location (for this example we will say "C:\test.html"). I want to be able to set the printer settings such as orientation, margins etc and if i can, choose what printer it comes out on. I have tried playing around with the printer control but cannot seem to work it out.
Also if possible, if there a way you can track the progress of the print?
Thanks in advance!
HTML source, or web page itself?
ASKER
My application generates HTML, saves it to C:\test.html and now i want to print test.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It is my solution althought it print out saying "C:\test.html" on the page.
I want to print html file not webpage itself.
Actually this is not what I want. I just saw one method
ShellExecute(IntPtr.Zero, "print", @filePath, "", Directory.GetDirectoryRoot (filePath) , SW_SHOWNORMAL)
When i am trying to run this method, its not giving me any error but its not printing anything.
Is anybody got anyidea why? Or please tell me other alternative to print html file from webpage.
ShellExecute(IntPtr.Zero, "print", @filePath, "", Directory.GetDirectoryRoot
When i am trying to run this method, its not giving me any error but its not printing anything.
Is anybody got anyidea why? Or please tell me other alternative to print html file from webpage.