Solved

landscape printing

Posted on 2002-05-09
8
1,141 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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.
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 +…

910 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

22 Experts available now in Live!

Get 1:1 Help Now