Hi @Ken Smith , Welcome to Microsoft Q&A,
printDoc.PrinterSettings.DefaultPageSettings.Margins.Left
-
PrinterSettings
refers to the settings associated with a specific printer.PrinterSettings.DefaultPageSettings
contains the default page settings associated with that printer. Changing the value ofPrinterSettings.DefaultPageSettings
affects all documents printed using the default settings for that printer. - For example:
printDoc.PrinterSettings.DefaultPageSettings.Margins.Left = 75
This code changes the page margins associated with the printer's default settings.
printDoc.DefaultPageSettings.Margins.Left
-
PrintDocument.DefaultPageSettings
contains the default page settings associated with the current print document instance. These settings apply only to the currentPrintDocument
instance. - For example:
printDoc.DefaultPageSettings.Margins.Left = 75
This code will only change the page margin settings of the current print document instance.
Usage scenarios
Scenario for using PrinterSettings.DefaultPageSettings
(statement (1)):
- Use
PrinterSettings.DefaultPageSettings
when you want to change the default settings associated with a specific printer. This is usually used to use the same printer settings uniformly in multiple print operations.
Scenario for using DefaultPageSettings
(statement (2)):
- Use
DefaultPageSettings
when you want to set specific page margins for the current print document instance. This is usually used for a single print operation, or when each print document instance may have different settings. Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.