Understanding PrinterSettings.DefaultPageSettings Property

S

SamSpade

I need to know the paper width, height and margins.

I have a few questions:

What does the word "default" in DefaultPageSettings indicate. For example,
does it mean that if the printer defaults to portrait, the values will
represent portrait even if the present document is in landscape? (Just a
guess).

Do the DefaultPageSettings reflect the selected orientation?
If not,what is the best way to get values that reflect the selected
orientation.
Do I need to use the landscapeangle property to get the margins?


Thanks for any suggestions,
 
A

Andreas Håkansson

Sam,

Normal a PageSettings class is used to define the settings on a per page
level,
that is, you can specify a PageSettings object for each page yuu print to
alter some
settings on a page basis. The DefaultPageSettings enables you to specify ONE
PageSettings object which should be used for ALL of the pages being printed.
The
documenation states the following for the property.

"Gets or sets page settings that are used as defaults for all pages to
be printed."

HTH,

//Andreas
 
S

SamSpade

Thanks a lot.

I've been playing with margins and paper sizes an it appears to me that they
do not change when I change from portrait to landscape.

Can you confirm that's true.


Thanks
 
A

Andreas Håkansson

Sam,

I can not confirm it in the sence that I've tested it myself with code
and
experinced the behaviour myself. However this is the behaviour I would
expect. The margins are defined a left, top, right and bottom and a left
margin is a left margin despite the orientation of the paper. I would not
expect the margins to rotate with the paper orientation, if this is what you
had in mind.

HTH,

//Andreas
 
S

SamSpade

If I set left margin to 2 while it's portriat and then set to landscape I
thought the left landscape margin should be 2. Is that what you expect
happens?
 
A

Andreas Håkansson

Sam,

Yes this is the behavious I would expect. Paper oriantation is rotated
while the margins are not. Are you experiencing rotated margins as well?

//Andreas
 
S

SamSpade

I'm not sure but as I look at the code and see the results I believe the
margins ( and also page width and height) do not rotate. I believe they did
when I used GetDeviceCaps but that was a while ago and I'm not sure.

If I tell a user the page width is 8.5 and he changes to landscape I need to
now tell him it's 11. I guess I'll have to show the height as the width in
that case ( think I'll also have to check to see if the printer defaults to
landscape or portrait).

Margins are more trouble because some printers rotate 90 degrees and some
270.

If the user says he wants 2' left margin and landscape (if the printer
defaults to portrait) I'll have to set either the top or bottom to 2 '
depending in the landscape angle). Not too nice but I'll do what I have to
do.

Do you agree with everything I said here?


Thanks a lot
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top