Removal of header and footer when printing (SOLVED)

We have compiled a simple application - the user inputs some information into a form, This returns a page based on the information the user has supplied which the user can print. The page prints fine but always includes the header (page title) and footer (path to page) - we do not want this included. We have tried switching the various options under Application Settings | Visual Controls | Printer in the complier including setting custom text but it makes no difference - the same header and footer prints every time. Any simple solution to switch off the printing of headers and footers?

OK - got it. Didn’t realise that HTML Executable was closely tied in with IE settings (IE9 on a test machine). In IE went to File|Page Setup and switched all header and footer options (three in each) to Empty. Works fine now.

I have the same problem. Is there solution without manual changing IE properties? From HE documentation it seems to be possible, but it doesn´t work for me (tested on WIN XP-IE8 and WIN7-IE10,11). Thanks

Hi

No - we tried everything and it only worked when the IE settings were changed from within IE. When we distribute the application we instruct users on how to do this.

Here is another way.
Use the following registry keys,

HKey_Current_User\Software\Microsoft\Internet Explorer\PageSetup
You will find the header, footer and other page settings that are available.

Create a couple of functions to save the current values for the header and footer, blank the header and footer and then restore them when the page has printed. Besides, blanking them out, you could also use a custom header and footer, when you print. Be sure to restore them back afterwards.

This way, you are not impacting the user to make the changes.

Hope this helps.

Could you write working script for this in hescript, which will be executed on onclick before javascript window.print() function? I don´t know how to write and read registry keys from HTML Executable. And how to change registry back after printing? It used to be working for me on IE8-11. Thanks

Trying this, but runtime error occured:
WriteRegistry
procedure WriteRegistry;
begin
WriteRegStr (HKEY_CURRENT_USER, “Software\Microsoft\Internet Explorer\PageSetup”, “header”, “”);
end;

Error:
Runtime error
File library macro.hex: Cannot install into registry. Key:
Software\Microsoft\Internet Explorer\PageSetup Indent: header Value
when evaluating instruction VallProc
($2,$4,$7E59A0,$3AC19B8,‘WriteRegStr’).
Stack content is: [UnicodeString:].
Source position: 1.439.

Please try to change “FooterText” and enable “OverrideDefoptions”. You must also uncheck “ShowPageSetup” in order to
work.