Home All Groups Group Topic Archive Search About

Changing Printer's default paper

Author
4 Oct 2006 5:41 AM
Panos
Hi all,
I am trying to print a report in A4 paper, but my printer's default paper is
different (Letter 8.5 x 11 inches). So when i print, a significant part of
the paper remains blank, because of the different margins. Does anyone know
how to programmatically change the printer's default paper? Almost all
properties of the Printersettings Class on this matter are ReadOnly.

Thank u

Panos

Author
4 Oct 2006 6:31 AM
ShaneO
Panos wrote:
> Hi all,
> I am trying to print a report in A4 paper, but my printer's default paper is
> different (Letter 8.5 x 11 inches). So when i print, a significant part of
> the paper remains blank, because of the different margins. Does anyone know
> how to programmatically change the printer's default paper? Almost all
> properties of the Printersettings Class on this matter are ReadOnly.
>
> Thank u
>
> Panos
>
Take a look at -

DefaultPageSettings.PaperSize.PaperName

or maybe consider showing the User a Dialog where they can select the size -

PrintDialog1.ShowDialog()
or use the PageSetupDialog

or better still, if as you wrote it's your own printer, then change the
default through "Printers and Faxes" within your operating system and
you won't need to worry too much about it.

There are a number of ways to do it, but you didn't state which version
of Visual Studio you're using.  The help within VS2005 provides a heap
of help, with complete code examples, for this topic.

Regards,

ShaneO

There are 10 kinds of people - Those who understand Binary and those who
don't.
Author
5 Oct 2006 5:04 AM
Panos
I' ll try it.

Thank u Shane()




Show quoteHide quote
"ShaneO" wrote:

> Panos wrote:
> > Hi all,
> > I am trying to print a report in A4 paper, but my printer's default paper is
> > different (Letter 8.5 x 11 inches). So when i print, a significant part of
> > the paper remains blank, because of the different margins. Does anyone know
> > how to programmatically change the printer's default paper? Almost all
> > properties of the Printersettings Class on this matter are ReadOnly.
> >
> > Thank u
> >
> > Panos
> >
> Take a look at -
>
> DefaultPageSettings.PaperSize.PaperName
>
> or maybe consider showing the User a Dialog where they can select the size -
>
> PrintDialog1.ShowDialog()
> or use the PageSetupDialog
>
> or better still, if as you wrote it's your own printer, then change the
> default through "Printers and Faxes" within your operating system and
> you won't need to worry too much about it.
>
> There are a number of ways to do it, but you didn't state which version
> of Visual Studio you're using.  The help within VS2005 provides a heap
> of help, with complete code examples, for this topic.
>
> Regards,
>
> ShaneO
>
> There are 10 kinds of people - Those who understand Binary and those who
> don't.
>
Author
8 Oct 2006 4:57 AM
Panos
Hi Shane()

I tried the code, but still no luck. When i set the PaperName property to a
papername other than the default, i get an exception, which says that i have
to set the Kind property to custom. But Kind property is ReadOnly.
Any ideas?

Show quoteHide quote
"ShaneO" wrote:

> Panos wrote:
> > Hi all,
> > I am trying to print a report in A4 paper, but my printer's default paper is
> > different (Letter 8.5 x 11 inches). So when i print, a significant part of
> > the paper remains blank, because of the different margins. Does anyone know
> > how to programmatically change the printer's default paper? Almost all
> > properties of the Printersettings Class on this matter are ReadOnly.
> >
> > Thank u
> >
> > Panos
> >
> Take a look at -
>
> DefaultPageSettings.PaperSize.PaperName
>
> or maybe consider showing the User a Dialog where they can select the size -
>
> PrintDialog1.ShowDialog()
> or use the PageSetupDialog
>
> or better still, if as you wrote it's your own printer, then change the
> default through "Printers and Faxes" within your operating system and
> you won't need to worry too much about it.
>
> There are a number of ways to do it, but you didn't state which version
> of Visual Studio you're using.  The help within VS2005 provides a heap
> of help, with complete code examples, for this topic.
>
> Regards,
>
> ShaneO
>
> There are 10 kinds of people - Those who understand Binary and those who
> don't.
>