By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,552 Members | 893 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,552 IT Pros & Developers. It's quick & easy.

Printing on a Custom Paper Size

P: n/a
Hi,

I want to programatically set the paper size of a print document. I created
a class that inherits PrintDocument, so I can print some database records on
8" x 10" paper.

I added this line to my class constructor:

Dim customPaperSize As New Printing.PaperSize("8x10", 800, 1000)

But now I am looking for the proper code lines so that any instance of my
class sends the proper size information to the printer, without user
intervention. How do I do it with VB.NET (with .NET 2.0)?

Thank you in advance,

Anne
Nov 14 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I noticed the following code line:

mDoc.DefaultPageSettings.PaperSize.Kind = PaperKind.Custom

But I got an error message stating that this property is readonly.

So, I can have my code behave like this:
Dim customPaperSize As New Printing.PaperSize("8x10", 800, 1000)

If mDoc.DefaultPageSettings.PaperSize.Kind = PaperKind.Custom Then
mDoc.DefaultPageSettings.PaperSize = customPaperSize
End If

But how can I change the PaperSize.Kind to Custom programmatically? I don't
want the user to worry about setting up the printer properly with the right
paper size. I only want the user to load their printer's manual feed tray
with the custom paper and then click on the Print button.

Any clue??????

Thanks in advance,

Anne

"Anne DeBlois" <an*********@community.nospama écrit dans le message de
news: Ow**************@TK2MSFTNGP02.phx.gbl...
Hi,

I want to programatically set the paper size of a print document. I
created a class that inherits PrintDocument, so I can print some database
records on 8" x 10" paper.

I added this line to my class constructor:

Dim customPaperSize As New Printing.PaperSize("8x10", 800, 1000)

But now I am looking for the proper code lines so that any instance of my
class sends the proper size information to the printer, without user
intervention. How do I do it with VB.NET (with .NET 2.0)?

Thank you in advance,

Anne

Nov 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.