Re: ah, **THOSE** headers/footers.
That looks good. Ta SP. Seen mention of scriptx but not a decent example of use. Will investigate tomorrow. Looking at this problem all day and my brain hurts. Time for vodka.
Thursday
That works a treat! Thanks very much sp! for yet another bit of good advice.
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Reply to: IE print templates
Collapse
You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:
- You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
- You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
- If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Logging in...
Previously on "IE print templates"
Collapse
-
Guest replied
-
Guest repliedah, **THOSE** headers/footers.
oops. sorry zog. can't do that from clientside script at the moment without that clunky tech you mentioned - templates. however, there is a freeb activex control you can use which easily does the job...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
html
head
script language="Javascript"!--
function doprint() {
//save existing user's info
var h = factory.printing.header;
var f = factory.printing.footer;
//hide the button
document.all("printbtn").style.visibility = 'hidden';
//set header and footer to blank
factory.printing.header = "";
factory.printing.footer = "";
//print page without prompt
factory.DoPrint(false);
//restore user's info
factory.printing.header = h;
factory.printing.footer = f;
//show the print button
document.all("printbtn").style.visibility = 'visible';
}
//--/script
/head
body
my test page.
object id=factory style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" viewastext
codebase="www.meadroid.com/scriptx/...6,1,431,8"
/object
brbr
div id="printbtn"input name=idPrint type=button value="Print the letter"
onclick="doprint()"/div
/body
/html
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
try that - i've stripped out all the html tagends.
Leave a comment:
-
Guest repliedRe: but
That's wierd. Just tried again scotty. Checked js function only contains
window.print();
and nowt else. And it prints headers/footers. I wonder if you happen to have blank values in the registry? That's where it gets the defaults from apparently.
PS
That does seem to be it. Opened any old page in IE, selected page setup, cleared header and footer strings, closed and tried window.print() again - no hdrs/ftrs. Not really a viable solution unfortunately.
PPS
From VB supposed to be able to use iWebBrowser2.exewb with third param containing necessary info. But how to put a iWebBrowser2 object in the project I have no idea. It's defined in same dll/oca asWebBrowser so should be available in controls.
PPPS
Pardon oh?
Leave a comment:
-
Guest repliedRe: but
Oy, you nose in the air bods, visual basics yu tool. Yeh!
Leave a comment:
-
Guest repliedbut
the javascript only prints out the screen - like a screen dump. i use it myself quite a lot...
Leave a comment:
-
Guest repliedRe: using
Ta for your time SP, but no can't get that to work, it prints headers and footers. As I say, the header/footer are added on by the IE dll, they are not anything in the original html so hiding anything in it is not going to make a difference.
Leave a comment:
-
Guest repliedusing
the javascript prints out the doc without any header stuff you mention. using the style, assigned to any bits you want not printed, such as
table style=hidden
td style=hidden
span style=hidden
will cause those elements not to be printed out.
so, just give your user a button to click that runs the javascript function.
Leave a comment:
-
Guest repliedRe: ...
Sorry SP not quite with you on 1st bit. I assume that's shorthand not actual syntax ie you mean summit like:
£STYLE type="text/css" media="print"£
span {visibility:hidden}
£/STYLE£
and stick hidden bits in a span?
How does that remove headers/footers? Maybe we are at cross purposes here, I mean the title, page 1 of 1 etc that IE sticks on when it prints, not anything actually on the HTML page.
Leave a comment:
-
Guest replied...
style =
nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
@media print {
.hidden { display: none }
nnnnnnnnnnnnnnnnnnnnnnnnnnnnn
javascript
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
function screenPrint()
{
document.body.style.zoom = '80%';
window.print();
document.body.style.zoom = '100%';
}
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
then use "span class='hidden'" etc
Leave a comment:
-
Guest replied...
you get rid of headers and footers by using style as well.....
Leave a comment:
-
Guest repliedif you
are automating internet exploer (?) then it should be straightforward.
Leave a comment:
-
Guest repliedRe: this is very simple
Ta SP. Just changing styles seems like a much easier option for the scaling, no probs with that. However, no way to get rid of/modify headers and footers from jscript is there?
These templates I mentioned seem like a non starter as am using webbrowser in VB and it seems, according to MS, that there is no mechanism for using from a VB app.
One really would have thought these days that there was a decent formal webbrowser method for formatting and scaling printout from a bog standard HTML page. Even the page setup in IE is total rubbish.
Leave a comment:
-
Guest repliedthis is very simple
with javascript and appropriate styles - let me know if you need more.
Leave a comment:
-
Guest started a topic IE print templatesIE print templates
Anyone ever used the MS IE print templates and has a simple sample of how to call print preview? Looked at stuff on MS and it seems like pages of incomprehensible earwig.
Basically I just want to print an HTML page without all that default header and footer stuff and also scale it so it fits on the printed page.
Much ta for any ideas.Tags: None
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Reports of umbrella companies’ death are greatly exaggerated Nov 28 10:11
- A new hiring fraud hinges on a limited company, a passport and ‘Ade’ Nov 27 09:21
- Is an unpaid umbrella company required to pay contractors? Nov 26 09:28
- The truth of umbrella company regulation is being misconstrued Nov 25 09:23
- Labour’s plan to regulate umbrella companies: a closer look Nov 21 09:24
- When HMRC misses an FTT deadline but still wins another CJRS case Nov 20 09:20
- How 15% employer NICs will sting the umbrella company market Nov 19 09:16
- Contracting Awards 2024 hails 19 firms as best of the best Nov 18 09:13
- How to answer at interview, ‘What’s your greatest weakness?’ Nov 14 09:59
- Business Asset Disposal Relief changes in April 2025: Q&A Nov 13 09:37
Leave a comment: