Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

landscape printing

Posted on 2002-05-09
8
Medium Priority
?
1,175 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 300 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
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…
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 +…

719 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