Sign in to follow this  
Followers 0
Fabry

Print a HTML file

5 posts in this topic

Hi, I am writting a program to show and print the bulletin of Lotto and SuperEnalotto.

I have made a html page whith IE UDF and now I want to print.

I export the html page in html file and use _PrintFile()

Func _PrintFile($filetoprint)
    RunWait(@ComSpec & ' /c rundll32.exe ' & @SystemDir & '\mshtml.dll,PrintHTML "' & $filetoprint, @TempDir, @SW_HIDE)
EndFunc   ;==>_PrintFile

Using this function, it prints headers and footings (number of page, URL, date and Time) and the print area is reduced.

How can I change margins? And how can I delete headers?

With print preview You can do this things, I know, but I want to be done in comand line.


A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza è il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi Why don't u use the print udf to print ur file.. That will definately solve all ur problems

Search this forum to find it!!

Edited by Manjish

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites

How can I change margins? And how can I delete headers?

With print preview You can do this things, I know, but I want to be done in comand line.

Have a look at the registry key: HKCU\Software\Microsoft\Internet Explorer\PageSetup

Best approach is to read and store the old values, write the new ones, invoke the print function, and then restore the old values.

If you invoke printing with something like $oIE.document.parentwindow.Print(), then you can reset the values immediately after that call; your custom values will be used for that instance of the print dialogue.

I wrote myself a UDF for this, but it's not really fit for public consumption at this time.

Share this post


Link to post
Share on other sites

Have a look at the registry key: HKCU\Software\Microsoft\Internet Explorer\PageSetup

Best approach is to read and store the old values, write the new ones, invoke the print function, and then restore the old values.

I understand this.

If you invoke printing with something like $oIE.document.parentwindow.Print(), then you can reset the values immediately after that call; your custom values will be used for that instance of the print dialogue.

Instead, how can I reset the values? Using the registry key?

Thanks a lot, I will use the first solution.


A lan chat (Multilanguage)LanMuleFile transferTank gameTank 2 an online game[center]L'esperienza è il nome che tutti danno ai propri errori.Experience is the name everyone gives to their mistakes.Oscar Wilde[/center]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0