473,378 Members | 1,346 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,378 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 4442
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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?

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.