public final class TextFrameFormat extends PVIObject implements ITextFrameFormat, IChartTextBlockFormat
Contains the TextFrame's formatTextFrameFormatting properties.
| Constructor and Description |
|---|
TextFrameFormat()
Initializes a new instance of
TextFrameFormat class. |
| Modifier and Type | Method and Description |
|---|---|
byte |
getAnchoringType()
Returns or sets vertical anchor text in a TextFrame.
|
byte |
getAutofitType()
Returns or sets text's autofit mode.
|
byte |
getCenterText()
If NullableBool.True then text should be centered in box horizontally.
|
int |
getColumnCount()
Returns or sets number of columns in the text area.
|
double |
getColumnSpacing()
Returns or sets the space between text columns in the text area (in points).
|
ITextFrameFormatEffectiveData |
getEffective()
Gets effective text frame formatting data with the inheritance applied.
|
boolean |
getKeepTextFlat()
Gets or sets keeping text flat even if a 3-D Rotation effect was applied.
|
double |
getMarginBottom()
Returns or sets the bottom margin (points) in a TextFrame.
|
double |
getMarginLeft()
Returns or sets the left margin (points) in a TextFrame.
|
double |
getMarginRight()
Returns or sets the right margin (points) in a TextFrame.
|
double |
getMarginTop()
Returns or sets the top margin (points) in a TextFrame.
|
float |
getRotationAngle()
Specifies custom the rotation that is being applied to the text within the bounding box.
|
ITextStyle |
getTextStyle()
Returns text's style.
|
byte |
getTextVerticalType()
Determines text orientation.
|
IThreeDFormat |
getThreeDFormat()
Returns the ThreeDFormat object that represents 3d effect properties for a text.
|
byte |
getTransform()
Gets or sets text wrapping shape.
|
long |
getVersion()
Version.
|
byte |
getWrapText()
True if text is wrapped at TextFrame's margins.
|
void |
setAnchoringType(byte value)
Returns or sets vertical anchor text in a TextFrame.
|
void |
setAutofitType(byte value)
Returns or sets text's autofit mode.
|
void |
setCenterText(byte value)
If NullableBool.True then text should be centered in box horizontally.
|
void |
setColumnCount(int value)
Returns or sets number of columns in the text area.
|
void |
setColumnSpacing(double value)
Returns or sets the space between text columns in the text area (in points).
|
void |
setKeepTextFlat(boolean value)
Gets or sets keeping text flat even if a 3-D Rotation effect was applied.
|
void |
setMarginBottom(double value)
Returns or sets the bottom margin (points) in a TextFrame.
|
void |
setMarginLeft(double value)
Returns or sets the left margin (points) in a TextFrame.
|
void |
setMarginRight(double value)
Returns or sets the right margin (points) in a TextFrame.
|
void |
setMarginTop(double value)
Returns or sets the top margin (points) in a TextFrame.
|
void |
setRotationAngle(float value)
Specifies custom the rotation that is being applied to the text within the bounding box.
|
void |
setTextVerticalType(byte value)
Determines text orientation.
|
void |
setTransform(byte value)
Gets or sets text wrapping shape.
|
void |
setWrapText(byte value)
True if text is wrapped at TextFrame's margins.
|
equals, getParent_Immediate, getParent_IPresentationComponent, getParent_ISlideComponent, getPresentation, getSlide, hashCodepublic TextFrameFormat()
Initializes a new instance of TextFrameFormat class.
public long getVersion()
Version.
Read-only long.
getVersion in class PVIObjectpublic final ITextStyle getTextStyle()
Returns text's style.
Read-only ITextStyle.
getTextStyle in interface ITextFrameFormatpublic final IThreeDFormat getThreeDFormat()
Returns the ThreeDFormat object that represents 3d effect properties for a text.
Read-only IThreeDFormat.
Presentation pres = new Presentation(); try { IAutoShape autoShape = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 10, 20, 400, 300); ITextFrame textFrame = autoShape.getTextFrame(); textFrame.setText("Aspose.Slide Test Text"); // Set text transformation textFrame.getTextFrameFormat().setTransform(TextShapeType.ArchUpPour); // Set Extrusion textFrame.getTextFrameFormat().getThreeDFormat().getExtrusionColor().setColor(Color.ORANGE); textFrame.getTextFrameFormat().getThreeDFormat().setExtrusionHeight(6); // Set Contour textFrame.getTextFrameFormat().getThreeDFormat().getContourColor().setColor(Color.DARK_GRAY); textFrame.getTextFrameFormat().getThreeDFormat().setContourWidth(1.5); // Set Depth textFrame.getTextFrameFormat().getThreeDFormat().setDepth(3); // Set Material textFrame.getTextFrameFormat().getThreeDFormat().setMaterial(MaterialPresetType.Plastic); // Set Lighting textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setDirection(LightingDirection.Top); textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setLightType(LightRigPresetType.Balanced); textFrame.getTextFrameFormat().getThreeDFormat().getLightRig().setRotation(0, 0, 40); // Set camera type textFrame.getTextFrameFormat().getThreeDFormat().getCamera().setCameraType(CameraPresetType.PerspectiveContrastingRightFacing); } finally { if (pres != null) pres.dispose(); }
getThreeDFormat in interface ITextFrameFormatpublic final double getMarginLeft()
Returns or sets the left margin (points) in a TextFrame.
Read/write double.
getMarginLeft in interface IChartTextBlockFormatgetMarginLeft in interface ITextFrameFormatpublic final void setMarginLeft(double value)
Returns or sets the left margin (points) in a TextFrame.
Read/write double.
setMarginLeft in interface IChartTextBlockFormatsetMarginLeft in interface ITextFrameFormatpublic final double getMarginRight()
Returns or sets the right margin (points) in a TextFrame.
Read/write double.
getMarginRight in interface IChartTextBlockFormatgetMarginRight in interface ITextFrameFormatpublic final void setMarginRight(double value)
Returns or sets the right margin (points) in a TextFrame.
Read/write double.
setMarginRight in interface IChartTextBlockFormatsetMarginRight in interface ITextFrameFormatpublic final double getMarginTop()
Returns or sets the top margin (points) in a TextFrame.
Read/write double.
getMarginTop in interface IChartTextBlockFormatgetMarginTop in interface ITextFrameFormatpublic final void setMarginTop(double value)
Returns or sets the top margin (points) in a TextFrame.
Read/write double.
setMarginTop in interface IChartTextBlockFormatsetMarginTop in interface ITextFrameFormatpublic final double getMarginBottom()
Returns or sets the bottom margin (points) in a TextFrame.
Read/write double.
getMarginBottom in interface IChartTextBlockFormatgetMarginBottom in interface ITextFrameFormatpublic final void setMarginBottom(double value)
Returns or sets the bottom margin (points) in a TextFrame.
Read/write double.
setMarginBottom in interface IChartTextBlockFormatsetMarginBottom in interface ITextFrameFormatpublic final byte getWrapText()
True if text is wrapped at TextFrame's margins.
Read/write NullableBool.
The following sample code shows how to wrap text in Presentation.Presentation pres = new Presentation(); try { ISlide slide = pres.getSlides().get_Item(0); IAutoShape autoShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 30, 30, 350, 100); Portion portion = new Portion("lorem ipsum..."); portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); autoShape.getTextFrame().getParagraphs().get_Item(0).getPortions().add(portion); ITextFrameFormat textFrameFormat = autoShape.getTextFrame().getTextFrameFormat(); textFrameFormat.setWrapText(NullableBool.True); pres.save("Output-presentation.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
getWrapText in interface IChartTextBlockFormatgetWrapText in interface ITextFrameFormatpublic final void setWrapText(byte value)
True if text is wrapped at TextFrame's margins.
Read/write NullableBool.
The following sample code shows how to wrap text in Presentation.Presentation pres = new Presentation(); try { ISlide slide = pres.getSlides().get_Item(0); IAutoShape autoShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 30, 30, 350, 100); Portion portion = new Portion("lorem ipsum..."); portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); autoShape.getTextFrame().getParagraphs().get_Item(0).getPortions().add(portion); ITextFrameFormat textFrameFormat = autoShape.getTextFrame().getTextFrameFormat(); textFrameFormat.setWrapText(NullableBool.True); pres.save("Output-presentation.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
setWrapText in interface IChartTextBlockFormatsetWrapText in interface ITextFrameFormatpublic final byte getAnchoringType()
Returns or sets vertical anchor text in a TextFrame.
Read/write TextAnchorType.
getAnchoringType in interface IChartTextBlockFormatgetAnchoringType in interface ITextFrameFormatpublic final void setAnchoringType(byte value)
Returns or sets vertical anchor text in a TextFrame.
Read/write TextAnchorType.
setAnchoringType in interface IChartTextBlockFormatsetAnchoringType in interface ITextFrameFormatpublic final byte getCenterText()
If NullableBool.True then text should be centered in box horizontally.
Read/write NullableBool.
getCenterText in interface IChartTextBlockFormatgetCenterText in interface ITextFrameFormatpublic final void setCenterText(byte value)
If NullableBool.True then text should be centered in box horizontally.
Read/write NullableBool.
setCenterText in interface IChartTextBlockFormatsetCenterText in interface ITextFrameFormatpublic final byte getTextVerticalType()
Determines text orientation.
The resulted value of visual text rotation summarized from this property and custom angle
in property RotationAngle.
Read/write TextVerticalType.
getTextVerticalType in interface IChartTextBlockFormatgetTextVerticalType in interface ITextFrameFormatpublic final void setTextVerticalType(byte value)
Determines text orientation.
The resulted value of visual text rotation summarized from this property and custom angle
in property RotationAngle.
Read/write TextVerticalType.
setTextVerticalType in interface IChartTextBlockFormatsetTextVerticalType in interface ITextFrameFormatpublic final byte getAutofitType()
Returns or sets text's autofit mode.
Read/write TextAutofitType.
The following sample code shows how to resize shape to Fit Text in a PowerPoint Presentation.Presentation pres = new Presentation(); try { ISlide slide = pres.getSlides().get_Item(0); IAutoShape autoShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 30, 30, 350, 100); Portion portion = new Portion("lorem ipsum..."); portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); autoShape.getTextFrame().getParagraphs().get_Item(0).getPortions().add(portion); ITextFrameFormat textFrameFormat = autoShape.getTextFrame().getTextFrameFormat(); textFrameFormat.setAutofitType(TextAutofitType.Shape); pres.save("Output-presentation.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }The following sample code shows how to shrink text on overflow.Presentation pres = new Presentation(); try { ISlide slide = pres.getSlides().get_Item(0); IAutoShape autoShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 30, 30, 350, 100); Portion portion = new Portion("lorem ipsum..."); portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); autoShape.getTextFrame().getParagraphs().get_Item(0).getPortions().add(portion); ITextFrameFormat textFrameFormat = autoShape.getTextFrame().getTextFrameFormat(); textFrameFormat.setAutofitType(TextAutofitType.Normal); pres.save("Output-presentation.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
getAutofitType in interface IChartTextBlockFormatgetAutofitType in interface ITextFrameFormatpublic final void setAutofitType(byte value)
Returns or sets text's autofit mode.
Read/write TextAutofitType.
The following sample code shows how to resize shape to Fit Text in a PowerPoint Presentation.Presentation pres = new Presentation(); try { ISlide slide = pres.getSlides().get_Item(0); IAutoShape autoShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 30, 30, 350, 100); Portion portion = new Portion("lorem ipsum..."); portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); autoShape.getTextFrame().getParagraphs().get_Item(0).getPortions().add(portion); ITextFrameFormat textFrameFormat = autoShape.getTextFrame().getTextFrameFormat(); textFrameFormat.setAutofitType(TextAutofitType.Shape); pres.save("Output-presentation.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }The following sample code shows how to shrink text on overflow.Presentation pres = new Presentation(); try { ISlide slide = pres.getSlides().get_Item(0); IAutoShape autoShape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 30, 30, 350, 100); Portion portion = new Portion("lorem ipsum..."); portion.getPortionFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK); portion.getPortionFormat().getFillFormat().setFillType(FillType.Solid); autoShape.getTextFrame().getParagraphs().get_Item(0).getPortions().add(portion); ITextFrameFormat textFrameFormat = autoShape.getTextFrame().getTextFrameFormat(); textFrameFormat.setAutofitType(TextAutofitType.Normal); pres.save("Output-presentation.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
setAutofitType in interface IChartTextBlockFormatsetAutofitType in interface ITextFrameFormatpublic final int getColumnCount()
Returns or sets number of columns in the text area.
This value must be a positive number. Otherwise, the value will be set to zero.
Value 0 means undefined value.
Read/write int.
The following sample code shows how to add column in Text frame inside a PowerPoint Presentation.Presentation pres = new Presentation(); try { IAutoShape shape1 = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 300, 300); TextFrameFormat format = (TextFrameFormat)shape1.getTextFrame().getTextFrameFormat(); format.setColumnCount(2); format.setColumnSpacing(20); shape1.getTextFrame().setText("All these columns are forced to stay within a single text container -- " + "you can add or delete text - and the new or remaining text automatically adjusts " + "itself to stay within the container. You cannot have text spill over from one container " + "to other, though -- because PowerPoint's column options for text are limited!"); pres.save("Columns_output.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
getColumnCount in interface ITextFrameFormatpublic final void setColumnCount(int value)
Returns or sets number of columns in the text area.
This value must be a positive number. Otherwise, the value will be set to zero.
Value 0 means undefined value.
Read/write int.
The following sample code shows how to add column in Text frame inside a PowerPoint Presentation.Presentation pres = new Presentation(); try { IAutoShape shape1 = pres.getSlides().get_Item(0).getShapes().addAutoShape(ShapeType.Rectangle, 100, 100, 300, 300); TextFrameFormat format = (TextFrameFormat)shape1.getTextFrame().getTextFrameFormat(); format.setColumnCount(2); format.setColumnSpacing(20); shape1.getTextFrame().setText("All these columns are forced to stay within a single text container -- " + "you can add or delete text - and the new or remaining text automatically adjusts " + "itself to stay within the container. You cannot have text spill over from one container " + "to other, though -- because PowerPoint's column options for text are limited!"); pres.save("Columns_output.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
setColumnCount in interface ITextFrameFormatpublic final double getColumnSpacing()
Returns or sets the space between text columns in the text area (in points). This should only apply
when there is more than 1 column present.
This value must be a positive number. Otherwise, the value will be set to zero.
Read/write double.
getColumnSpacing in interface ITextFrameFormatpublic final void setColumnSpacing(double value)
Returns or sets the space between text columns in the text area (in points). This should only apply
when there is more than 1 column present.
This value must be a positive number. Otherwise, the value will be set to zero.
Read/write double.
setColumnSpacing in interface ITextFrameFormatpublic final float getRotationAngle()
Specifies custom the rotation that is being applied to the text within the bounding box. If it not
specified, the rotation of the accompanying shape is used. If it is specified, then this is
applied independently from the shape. That is the shape can have a rotation applied in
addition to the text itself having a rotation applied to it.
The resulted value of visual text rotation summarized from this property and predefined
vertical type in property TextVerticalType.
Read/write float.
Consider the case where a shape has a rotation of 90 degrees clockwise applied to it. In addition to this, the text body itself has a rotation of -90 degrees counter-clockwise applied to it. Then the resulting shape would appear to be rotated but the text within it would appear as though it had not been rotated at all.
getRotationAngle in interface IChartTextBlockFormatgetRotationAngle in interface ITextFrameFormatpublic final void setRotationAngle(float value)
Specifies custom the rotation that is being applied to the text within the bounding box. If it not
specified, the rotation of the accompanying shape is used. If it is specified, then this is
applied independently from the shape. That is the shape can have a rotation applied in
addition to the text itself having a rotation applied to it.
The resulted value of visual text rotation summarized from this property and predefined
vertical type in property TextVerticalType.
Read/write float.
Consider the case where a shape has a rotation of 90 degrees clockwise applied to it. In addition to this, the text body itself has a rotation of -90 degrees counter-clockwise applied to it. Then the resulting shape would appear to be rotated but the text within it would appear as though it had not been rotated at all.
setRotationAngle in interface IChartTextBlockFormatsetRotationAngle in interface ITextFrameFormatpublic final byte getTransform()
Gets or sets text wrapping shape.
Read/write TextShapeType.
getTransform in interface ITextFrameFormatpublic final void setTransform(byte value)
Gets or sets text wrapping shape.
Read/write TextShapeType.
setTransform in interface ITextFrameFormatpublic final boolean getKeepTextFlat()
Gets or sets keeping text flat even if a 3-D Rotation effect was applied.
Read/write boolean.
getKeepTextFlat in interface ITextFrameFormatpublic final void setKeepTextFlat(boolean value)
Gets or sets keeping text flat even if a 3-D Rotation effect was applied.
Read/write boolean.
setKeepTextFlat in interface ITextFrameFormatpublic final ITextFrameFormatEffectiveData getEffective()
Gets effective text frame formatting data with the inheritance applied.
This example demonstrates getting some of effective text frame formatting properties.Presentation pres = new Presentation("MyPresentation.pptx"); try { IAutoShape shape = (IAutoShape)pres.getSlides().get_Item(0).getShapes().get_Item(0); ITextFrameFormatEffectiveData effectiveTextFrameFormat = shape.getTextFrame().getTextFrameFormat().getEffective(); System.out.println("Anchoring type: " + effectiveTextFrameFormat.getAnchoringType()); System.out.println("Autofit type: " + effectiveTextFrameFormat.getAutofitType()); System.out.println("Text vertical type: " + effectiveTextFrameFormat.getTextVerticalType()); System.out.println("Margins"); System.out.println(" Left: " + effectiveTextFrameFormat.getMarginLeft()); System.out.println(" Top: " + effectiveTextFrameFormat.getMarginTop()); System.out.println(" Right: " + effectiveTextFrameFormat.getMarginRight()); System.out.println(" Bottom: " + effectiveTextFrameFormat.getMarginBottom()); } finally { if (pres != null) pres.dispose(); }
getEffective in interface ITextFrameFormatITextFrameFormatEffectiveData.Copyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.