473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Changing Print Options

Hi,

I have an asp.net (v2) webpage with has a print button on
it, I would like to change two local print settings automatically when it is
pressed and change them back after it has printed. The settings I want to
change are portrait to landscape and to select print background colours and
images.

Can this be done? if so how?

Thanks

May 10 '07 #1
2 1215
You can set print background colors and images. You can do it either with
css styles (google on something like "css print background" and you will
find a lot of articles on that) or with javascript events onbeforeprint and
onafterprint.

You can't change to landscape since it is a local printer's setting which
you can't set from a web page unless you allow a special security or employ
an ActiveX.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Adrian" <ag@silversprings.me.ukwrote in message
news:6A**********************************@microsof t.com...
Hi,

I have an asp.net (v2) webpage with has a print button on
it, I would like to change two local print settings automatically when it
is pressed and change them back after it has printed. The settings I want
to change are portrait to landscape and to select print background colours
and images.

Can this be done? if so how?

Thanks

May 10 '07 #2
Hello,

You cannot change client-side printer settings from browser JS code.

"Adrian" wrote:
Hi,

I have an asp.net (v2) webpage with has a print button on
it, I would like to change two local print settings automatically when it is
pressed and change them back after it has printed. The settings I want to
change are portrait to landscape and to select print background colours and
images.

Can this be done? if so how?

Thanks
May 10 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michelle | last post by:
I have tried every variation of the "onchange" statement below without any actual reloading of the page. I am hoping that the PHP PRINT statement is constructed wrong, otherwise it is javaScript...
7
by: Hal Vaughan | last post by:
I have a sample script from a book ("Beginning JavaScript" by Paul Wilton) that removes or adds a choice to a <SELECT> element. The <FORM> is form1 and the <SELECT> is theDay. The example uses...
3
by: Ben | last post by:
I have two drop down box's in a form, how would I go about changing the options of the seccond one depending on what option is selected in the first one? For example, if there's a drop down box...
3
by: June Moore | last post by:
Hi all, Is there a way to use javascript to change a web page's default layout e.g. change page orientation to landscape or portrait when the user prints a copy of the webpage? Thanks, June..
6
by: swartzbill2000 | last post by:
Hello, I have a VB 2005 Express project with a TraceListener-derived class to route Debug.Print output to a log file. It works fine for Debug builds. What is the correct combination of changes to...
4
by: andychambers2002 | last post by:
I'm working on a "TempFile" class that stores the data in memory until it gets larger than a specified threshold (as per PEP 42). Whilst trying to implement it, I've come across some strange...
4
by: Jessica | last post by:
Page: http://www.doublooncove.com/signup.php Problem: In Firefox, the changes work fine. In IE, the images just disappear, and there is a broken image. The images are THERE. Some are blank...
4
by: PengYu.UT | last post by:
Suppose I have a dos format text file. The following python code will print ^M at the end. I'm wondering how to print it in unix format. fh = open(options.filename) for line in fh.readlines()...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.