Solved

landscape printing

Posted on 2002-05-09
8
1,132 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
  • 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
I recently found myself in a Corporate Situation where the client had requested blocking access to any and all websites except his own Domain? Easy? I am sure this would be your answer but their requirement was, this has to be done without using…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now