473,387 Members | 1,431 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,387 software developers and data experts.

How to construct a PaperSize object in .net

There is a PaperSize class in .net framework. But it has only one
constructor: [C#]public PaperSize(string name,int width,int height);
I want to create a object whose kind isn't "Customer". How shall I do?
Thank you
Jerry
Nov 16 '05 #1
4 4444
Jerry,

Why would you have to name it "Customer"? Why not just pass whatever
name you want to it?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"°Ë´óɽÈË" <zh**********@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
There is a PaperSize class in .net framework. But it has only one
constructor: [C#]public PaperSize(string name,int width,int height);
I want to create a object whose kind isn't "Customer". How shall I do?
Thank you
Jerry

Nov 16 '05 #2
Hi,

This name just is a description, its Kind property is "Customer"
I want to create a object whose Kind isn't "Customer".
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eT*************@tk2msftngp13.phx.gbl...
Jerry,

Why would you have to name it "Customer"? Why not just pass whatever
name you want to it?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"°Ë´óɽÈË" <zh**********@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
There is a PaperSize class in .net framework. But it has only one
constructor: [C#]public PaperSize(string name,int width,int height);
I want to create a object whose kind isn't "Customer". How shall I do?
Thank you
Jerry


Nov 16 '05 #3
°Ë´óɽÈË <zh**********@hotmail.com> wrote:
This name just is a description, its Kind property is "Customer"
I want to create a object whose Kind isn't "Customer".


I think you've confused things somewhat by saying "Customer" instead of
"Custom". As I understand it, the problem is that you want to use a
standard size of paper, rather than a custom one, correct?

It looks like the normal way of doing that is to use
PrinterSettings.PaperSizes to get a collection of paper sizes supported
by your printer, and select one of those.

Why does the kind of paper matter to you, out of interest?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
Thank you.

I'm writing a program, need a class like PaperSize to represent a
Page, I want to
use PaperSize class, but I can't find the right Constructor. I know it by
Reflector now.
The Constructor PaperSize(string name, PaperKind kind, int width, int
height) is internal,
We can't access it. It seems that I have to write one for myself.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
°Ë´óɽÈË <zh**********@hotmail.com> wrote:
This name just is a description, its Kind property is "Customer"
I want to create a object whose Kind isn't "Customer".


I think you've confused things somewhat by saying "Customer" instead of
"Custom". As I understand it, the problem is that you want to use a
standard size of paper, rather than a custom one, correct?

It looks like the normal way of doing that is to use
PrinterSettings.PaperSizes to get a collection of paper sizes supported
by your printer, and select one of those.

Why does the kind of paper matter to you, out of interest?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #5

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

Similar topics

0
by: Pedro Feio | last post by:
Hi, I'm having a weird problem setting up the paper size in a C# Windows Forms Application. The code I'm using is something like this: PrintDocument pd = new PrintDocument(); ...
0
by: Raul | last post by:
I need to define a papersize 8.5'', 15'. I define it using propertysettings and papersize collection in C# but the printer don't print when the datas is below to 11''. My printer is HP Laserjet...
0
by: epederiva | last post by:
Hi, I have a problem with a laser feed tractor printer, paper size is 8.3 X 11 inc.. For print in windows xp home from a c# application i use a custom paper size added at the printer server...
0
by: °Ë´óɽÈË | last post by:
Hi, This name just is a description, its Kind property is "Customer" I want to create a object whose Kind isn't "Customer". "Nicholas Paldino " <mvp@spam.guard.caspershouse.com> wrote in...
1
by: bafidi | last post by:
i want to write a code and make the papersize A but this code is wrong what is the true on PrintDocument1.DefaultPageSettings.papersize=A4
0
by: toufik | last post by:
I'm using a printDocument object to print a text. How can I set the paper size fomat to LETTER format here is the code that I started, I don't know if its the good direction....
0
by: Madern | last post by:
Good Morning, I'm developing a code that needs to deal with different printer user formats which have to be created on a network driver printer (OKI 321). The big issue I am finding is that the...
0
by: Madern | last post by:
Good Morning, I'm developing a code that needs to deal with different printer user formats which have to be created on a network driver printer (OKI 321). The big issue I am finding is that the...
0
by: Amir Alilou | last post by:
hi I want to change the size of paper prorammatically in my code. but when i do it my printer paper size do not change. please help me with sample.(VB.NET 2003) Public Sub Print_It() Try Try...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.