FlowDocument::PagePadding Property
Gets or sets a value that indicates the thickness of padding space between the boundaries of a page and the page's content.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
<object> <object.PagePadding> <Thickness .../> </object.PagePadding> </object>
<object PagePadding="uniformThickness"/> - or - <object PagePadding="independentThickness"/> - or - <object PagePadding="qualifiedUniformThickness"/> - or - <object PagePadding="qualifiedIndependentThickness"/>
XAML Values
Property Value
Type: System.Windows::ThicknessA Thickness structure that specifies the amount of padding to apply, in device independent pixels. The default is a uniform thickness of zero (0.0).
PagePadding can be described as uniform in all directions (PagePadding="10"), or as four distinct values that represent left, top, right, and bottom padding independently (PagePadding="5,0,10,20").
If a specified padding thickness exceeds the corresponding page dimension (for example, the sum of the left and right padding widths exceeds the page width), the thickness of the padding will be proportionally reduced to be no greater than the relevant page dimension.
The following examples show various ways to set the PagePadding attribute of a FlowDocument element.
<FlowDocumentReader> <FlowDocument PagePadding="10"> <Paragraph>Padding is 10 pixels all around.</Paragraph> </FlowDocument> </FlowDocumentReader> <FlowDocumentReader> <FlowDocument PagePadding="1.5in"> <Paragraph>Padding is 1 and a half inches all around.</Paragraph> </FlowDocument> </FlowDocumentReader> <FlowDocumentReader> <FlowDocument PagePadding="5,10,5,10"> <Paragraph>Padding is 5 pixels on the right and left, and 10 pixels on the top and botton.</Paragraph> </FlowDocument> </FlowDocumentReader> <FlowDocumentReader> <FlowDocument PagePadding="0.8in,20,0.8in,20"> <Paragraph>Padding is 1 eigth of an inch on the right and left, and 20 pixels on the top and botton.</Paragraph> </FlowDocument> </FlowDocumentReader>
The following example shows how to set the PagePadding property programmatically.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.