Skip to main content

Метод TextBox::getGeometryProperties

Метод возвращает геометрические свойства текстового поля GeometryProperties.

Пример для текстового документа:​


CO::API::Document::TextBoxes textBoxes = document.getRange().getTextBoxes();
std::shared_ptr<Enumerator<TextBox>> enumerator = textBoxes.getEnumerator();
while (enumerator->isValid())
{
TextBox textBox = enumerator->getCurrent();
GeometryProperties geometryProperties = textBox.getGeometryProperties()
if (geometryProperties.rotation)
{
std::printf("%f", *geometryProperties.rotation);
}
if (geometryProperties.horizontalFlip)
{
std::printf("%d", *geometryProperties.horizontalFlip);
}
if (geometryProperties.verticalFlip)
{
std::printf("%d", *geometryProperties.verticalFlip);
}
enumerator->goToNext();
}

Пример для табличного документа:​


std::shared_ptr<Enumerator<TextBox>> textBoxesEnumerator = table.getTextBoxes().getEnumerator();
while (textBoxesEnumerator->isValid())
{
TextBox textBox = textBoxesEnumerator->getCurrent();

GeometryProperties geometryProperties = textBox.getGeometryProperties()
if (geometryProperties.rotation)
{
std::printf("%f", *geometryProperties.rotation);
}
if (geometryProperties.horizontalFlip)
{
std::printf("%d", *geometryProperties.horizontalFlip);
}
if (geometryProperties.verticalFlip)
{
std::printf("%d", *geometryProperties.verticalFlip);
}

shapesEnumerator->goToNext();
}