473,666 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(strin g 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 4475
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.co m

"°Ë´óɽÈË" <zh**********@h otmail.com> wrote in message
news:uP******** ******@TK2MSFTN GP10.phx.gbl...
There is a PaperSize class in .net framework. But it has only one
constructor: [C#]public PaperSize(strin g 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.c om> wrote in
message news:eT******** *****@tk2msftng p13.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.co m

"°Ë´óɽÈË" <zh**********@h otmail.com> wrote in message
news:uP******** ******@TK2MSFTN GP10.phx.gbl...
There is a PaperSize class in .net framework. But it has only one
constructor: [C#]public PaperSize(strin g 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**********@h otmail.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.co m>
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(strin g 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.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
°Ë´óɽÈË <zh**********@h otmail.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.co m>
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
1361
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(); pd.DefaultPageSettings.Margins.Left = 0; pd.DefaultPageSettings.Margins.Right = 0;
0
2124
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 1100 and I can not change the printer's configuration. Somebody help me ?
0
1879
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 properties. The problem is that i have to print a value near bottom margin (sheets are pre-printed), but if i use custom papersize this value will not printed, i think because there is a bottom margin, but in my custom paper size i have set all margins...
0
283
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 message news:eTIE$xNPEHA.808@tk2msftngp13.phx.gbl... > Jerry, >
1
1536
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
1148
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. System.Drawing.Printing.PrintDocument pr = new System.Drawing.Printing.PrintDocument() pr.DefaultPageSettings.PaperSize=pr.PrinterSettings.PaperSizes(??????) thanks.
0
1424
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 printer doesn't allow me to handle with more than 1 defined format at the same time. We could say it allows me to define just ONE format at a time (and it is going to work with the last format I set), even though the settings
0
1894
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 printer doesn't allow me to handle with more than 1 defined format at the same time. We could say it allows me to define just ONE format at a time (and it is going to work with the last format I set), even though the settings
0
3204
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 'PrintFont = New Font("Arial", 10) Dim pd As PrintDocument = New PrintDocument
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8869
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.