Метод Aspose::Words::Saving::HtmlFixedSaveOptions::get_PageMargins
Содержание
[
Скрывать
]HtmlFixedSaveOptions::get_PageMargins method
Указывает отступы вокруг страниц в документе HTML. Значение отступов измеряется в пунктах и должно быть равно или больше 0. Значение по умолчанию — 10 пунктов.
double Aspose::Words::Saving::HtmlFixedSaveOptions::get_PageMargins() const
Примечания
Зависит от значения свойства PageHorizontalAlignment:
- Defines top, bottom and left page margins if the value is Left.
- Defines top, bottom and right page margins if the value is Right.
- Defines top and bottom page margins if the value is Center.
Примеры
Показывает, как настроить поля страниц при сохранении документа в HTML.
auto doc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"Document.docx");
auto saveOptions = System::MakeObject<Aspose::Words::Saving::HtmlFixedSaveOptions>();
saveOptions->set_PageMargins(15);
doc->Save(get_ArtifactsDir() + u"HtmlFixedSaveOptions.PageMargins.html", saveOptions);
System::String outDocContents = System::IO::File::ReadAllText(get_ArtifactsDir() + u"HtmlFixedSaveOptions.PageMargins/styles.css");
ASSERT_TRUE(System::Text::RegularExpressions::Regex::Match(outDocContents, u"[.]awpage { position:relative; border:solid 1pt black; margin:15pt auto 15pt auto; overflow:hidden; }")->get_Success());
См. также
- Class HtmlFixedSaveOptions
- Namespace Aspose::Words::Saving
- Library Aspose.Words for C++