How to align ViewMaster (Vertical) to LEFT side of the page in the word/pdf ?
We have achieved inserting ViewMaster (vertical) in the document by following below link How to apply built-in footer style using Aspose Word?
#aspose.words #aspose
You should simply change alignment of paragraph in the inserted header using ParagraphFormat.Alignment. If you insert ViewMaster header as the primary header, you can use code like this to change alignment of paragraphs in it:
foreach (Paragraph p in doc.FirstSection.HeadersFooters[HeaderFooterType.HeaderPrimary].Paragraphs)
p.ParagraphFormat.Alignment = ParagraphAlignment.Left;
In case of ViewMaster (Vertical) footer, vertical contetn is represented using shape and group shape in footer. So you can use code like this to change position of these shapes:
Document doc = new Document(@"C:\Temp\in.docx");
MoveShapesLeft(doc.FirstSection.HeadersFooters[HeaderFooterType.FooterPrimary].GetChildNodes(NodeType.Shape, true));
MoveShapesLeft(doc.FirstSection.HeadersFooters[HeaderFooterType.FooterPrimary].GetChildNodes(NodeType.GroupShape, true));
doc.Save(@"C:\Temp\out.docx");
private static void MoveShapesLeft(NodeCollection shapes)
{
foreach (ShapeBase shape in shapes)
{
if (!shape.IsTopLevel)
continue;
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Margin;
shape.HorizontalAlignment = HorizontalAlignment.Left;
}
}