Specifies to what the vertical position of a shape or text frame is relative.
[Visual Basic]
Public Enum RelativeVerticalPosition
[C#]public enum RelativeVerticalPosition
Remarks
Example
Shows how to insert a floating image in the middle of a page.
[C#]
// This creates a builder and also an empty document inside the builder.
DocumentBuilder builder = new DocumentBuilder();
// By default, the image is inline.
Shape shape = builder.InsertImage(MyDir + "Aspose.Words.gif");
// Make the image float, put it behind text and center on the page.
shape.WrapType = WrapType.None;
shape.BehindText = true;
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
shape.HorizontalAlignment = HorizontalAlignment.Center;
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page;
shape.VerticalAlignment = VerticalAlignment.Center;
builder.Document.Save(MyDir + "Image.CreateFloatingPageCenter Out.doc");
[Visual Basic]
' This creates a builder and also an empty document inside the builder.
Dim builder As DocumentBuilder = New DocumentBuilder()
' By default, the image is inline.
Dim shape As Shape = builder.InsertImage(MyDir & "Aspose.Words.gif")
' Make the image float, put it behind text and center on the page.
shape.WrapType = WrapType.None
shape.BehindText = True
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page
shape.HorizontalAlignment = HorizontalAlignment.Center
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page
shape.VerticalAlignment = VerticalAlignment.Center
builder.Document.Save(MyDir & "Image.CreateFloatingPageCenter Out.doc")
Inserts a watermark image into a document using DocumentBuilder.
[C#]
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// The best place for the watermark image is in the header or footer so it is shown on every page.
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
System.Drawing.Image image = System.Drawing.Image.FromFile(MyDir + "Watermark.png");
// Insert a floating picture.
Shape shape = builder.InsertImage(image);
shape.WrapType = WrapType.None;
shape.BehindText = true;
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page;
// Calculate image left and top position so it appears in the centre of the page.
shape.Left = (builder.PageSetup.PageWidth - shape.Width) / 2;
shape.Top = (builder.PageSetup.PageHeight - shape.Height) / 2;
doc.Save(MyDir + "DocumentBuilder.InsertWatermark Out.doc");
[Visual Basic]
Dim doc As Document = New Document()
Dim builder As DocumentBuilder = New DocumentBuilder(doc)
' The best place for the watermark image is in the header or footer so it is shown on every page.
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary)
Dim image As System.Drawing.Image = System.Drawing.Image.FromFile(MyDir & "Watermark.png")
' Insert a floating picture.
Dim shape As Shape = builder.InsertImage(image)
shape.WrapType = WrapType.None
shape.BehindText = True
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page
' Calculate image left and top position so it appears in the centre of the page.
shape.Left = (builder.PageSetup.PageWidth - shape.Width) / 2
shape.Top = (builder.PageSetup.PageHeight - shape.Height) / 2
doc.Save(MyDir & "DocumentBuilder.InsertWatermark Out.doc")
Members
| Member Name | Description | Value |
| Margin | The object is positioned relative to the top page margin. | 0 |
| Page | The object is positioned relative to the top edge of the page. | 1 |
| Paragraph | The object is positioned relative to the top of the paragraph that contains the anchor. | 2 |
| Line | Undocumented. | 3 |
| Default | Default value is Paragraph. | 2 |
Requirements
Namespace: Aspose.Words.Drawing
Assembly: Aspose.Words (in Aspose.Words.dll)
See Also
Aspose.Words.Drawing Namespace | RelativeVerticalPosition