PageHorizontalAlignment
Contenido
[
Ocultar
]HtmlFixedSaveOptions.PageHorizontalAlignment property
Especifica la alineación horizontal de las páginas en un documento HTML. El valor predeterminado esCenter .
public HtmlFixedPageHorizontalAlignment PageHorizontalAlignment { get; set; }
Ejemplos
Muestra cómo configurar la alineación horizontal de las páginas al guardar un documento en HTML.
Document doc = new Document(MyDir + "Rendering.docx");
HtmlFixedSaveOptions htmlFixedSaveOptions = new HtmlFixedSaveOptions
{
PageHorizontalAlignment = pageHorizontalAlignment
};
doc.Save(ArtifactsDir + "HtmlFixedSaveOptions.HorizontalAlignment.html", htmlFixedSaveOptions);
string outDocContents = File.ReadAllText(ArtifactsDir + "HtmlFixedSaveOptions.HorizontalAlignment/styles.css");
switch (pageHorizontalAlignment)
{
case HtmlFixedPageHorizontalAlignment.Center:
Assert.True(Regex.Match(outDocContents,
"[.]awpage { position:relative; border:solid 1pt black; margin:10pt auto 10pt auto; overflow:hidden; }").Success);
break;
case HtmlFixedPageHorizontalAlignment.Left:
Assert.True(Regex.Match(outDocContents,
"[.]awpage { position:relative; border:solid 1pt black; margin:10pt auto 10pt 10pt; overflow:hidden; }").Success);
break;
case HtmlFixedPageHorizontalAlignment.Right:
Assert.True(Regex.Match(outDocContents,
"[.]awpage { position:relative; border:solid 1pt black; margin:10pt 10pt 10pt auto; overflow:hidden; }").Success);
break;
}
Ver también
- enum HtmlFixedPageHorizontalAlignment
- class HtmlFixedSaveOptions
- espacio de nombres Aspose.Words.Saving
- asamblea Aspose.Words