Solved

landscape printing

Posted on 2002-05-09
8
1,159 Views
Last Modified: 2012-08-13
I just need to be able to have a button on
my web page that says "Print Landscape" and
have that page be sent to the default printer
using landscape mode.

Please help!


-----Lori
0
Comment
Question by:loriwang7310
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 30

Expert Comment

by:weed
ID: 6999167
Cant do it. Each printer driver is different and is not controllable with javascript etc. Even if you could get it to work with printer X, it still wouldnt work for printer A-W. Not to mention that you'd have to do it for at least 3 different OSs.
0
 

Author Comment

by:loriwang7310
ID: 6999229
weed,

No, think not.  I am reading out on:

msdn.microsoft.com/library/en-us/dnie55/html/wb_print.asp?frame=true

that you can.  I just can't understand the directions.

I think they are saying that you can use an ActiveX control
and call it from a script to get access to the webbrowsers
print control, like this:

<HTML>
<HEAD>
<OBJECT ID="wbp" CLASSID="CLSID:778C58A9-81B6-11D3-BB8F-00C04FA3471C"></OBJECT>
<SCRIPT LANGUAGE="VBScript">
Sub Print()
If Len(wbp.DefaultPrinterName) = 0 Then
MsgBox "No default printer!"
Exit Sub
End If
MsgBox "Printing Landscape!"+wbp.DefaultPrinterName
wbp.Orientation = 2
wbp.Print
End Sub
</SCRIPT>
</HEAD>
<BODY>
<H3>This is a test</H3>
<INPUT TYPE="BUTTON" VALUE="Print" ONCLICK="Print()">
</BODY>
</HTML>


I have an ActiveX control pad but there is not webbrowser
print control object in the selection list.  I need to
know how to make an ActiveX web print control object.
Or I would even settle for a little page setup box that
would come up when the user clicked on the button.

Anybody out there know how to do this?

-----Lori


0
 
LVL 30

Expert Comment

by:weed
ID: 6999296
Youre assuming that everyone is using windows, which theyre not.
0
To Patch or not to Patch? That is the question!

Don't get caught out like thousands of others around the world in the recent Ransomware Fiasco!
Discuss..
- Why it's not a good idea to wait before Patching
- Sensible approaches to Patching discussed
- Add your feedback, comments and suggestions

 

Author Comment

by:loriwang7310
ID: 6999399
Hey, weed,  I got something working!  I can
never figure out my problems until I ask the
experts-exchange.  I don't know what it is.

I found something called ScriptX and now
it is working:

<HTML>
<HEAD><TITLE>Landscape Printing Test</TITLE>
</HEAD>
<BODY BGCOLOR="9FCFCF" TEXT="000000" LINK="4E5CCC" VLINK="CC1A11">
<!-- MeadCo Security Manager -->
<object viewastext style="display:none"
  classid="clsid:5445be81-b796-11d2-b931-002018654e2e"
  codebase="smsx.cab#Version=6,0,0,421">
  <param name="GUID" value="{1FB3613D-2B04-11D4-A695-0000863B364E}">
  <param name="Path" value="sxlic.mlf">
  <param name="Revison" value="0">
</object>


<!-- MeadCo ScriptX -->
<object id=factory style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
     viewastext codebase="Scriptx.cab#Version=6,0,0,421">
</object>

<script defer>
function window.onload() {
  factory.printing.SetMarginMeasure(2) // margins in inches
  factory.printing.leftMargin = 1.0
  factory.printing.topMargin = 0.75
  factory.printing.rightMargin = 0.75
  factory.printing.bottomMargin = 0.75
  factory.printing.portrait = false

}
</script>
<h1> this is a test of landscape printing</h1>

<FORM>
<BR><INPUT TYPE="button" value="Print Landscape" onClick="factory.printing.Print(false)">

</FORM>
</BODY>
</HTML>

Of course, this probably won't work right on the
end-users machine because I don't know enough about
ActiveX.   They are probably gonna have to have
the ScriptX cab files on their PC?  Do you know?

----Lori
0
 
LVL 30

Expert Comment

by:weed
ID: 6999747
Does it work for all browsers, all platforms, all printers, and all operating systems? Probably not. That's the catch. Certainly wont work on a Mac or *nix machine if youre using ActiveX.
0
 

Author Comment

by:loriwang7310
ID: 6999813
Yeah, the webserver that I'm using is a Sparc
and I'm going through an Oracle Application
Server.  I think I'm finding out it only works
off my PC not when I try to use it over the
webserver.  It keeps saying

Problem: Unauthorized site, or invalid security zone.

So, I'm stuck again and I'm leaving.  I've had it.
You wouldn't think just getting something to print landscape would be so complicated.

----Lori
0
 
LVL 30

Accepted Solution

by:
weed earned 100 total points
ID: 6999838
Youve got too many variables to ever get it to work in the real world.
0
 

Author Comment

by:loriwang7310
ID: 7002115
weed,

Well, it's working now.  I think I was
slap happy yesterday.  The end-user has
to execute this ScriptX.exe file on their
PC to put things into the registry.  

I'm awarding you the 100 points for
talking me down!

Thanks, bud.

----Lori
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question