com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Class PortionFormat

  • All Implemented Interfaces:
    IBasePortionFormat, IHyperlinkContainer, IPortionFormat


    public class PortionFormat
    extends BasePortionFormat
    implements IPortionFormat

    This class contains the text portion formatting properties. Unlike PortionFormatEffectiveData, all properties of this class are writeable.


    This class is used to return and manipulate text portion formatting properties defined for the particular portion. This means that no inheritance is applied when getting values so for the majority of cases you will get values meaning "undefined".

    In order to get the effective formatting parameter values including inherited you need to use getEffective() method which returns a PortionFormatEffectiveData instance.

    • Constructor Detail

      • PortionFormat

        public PortionFormat()

        Initializes a new instance of PortionFormat class.

    • Method Detail

      • getBookmarkId

        public final java.lang.String getBookmarkId()

        Returns or sets bookmark identifier. Read/write String.

        Specified by:
        getBookmarkId in interface IPortionFormat
      • setBookmarkId

        public final void setBookmarkId(java.lang.String value)

        Returns or sets bookmark identifier. Read/write String.

        Specified by:
        setBookmarkId in interface IPortionFormat
      • getSmartTagClean

        public final boolean getSmartTagClean()

        Determines whether the smart tag should be cleaned. No inheritance applied. Read/write boolean.

        Specified by:
        getSmartTagClean in interface IPortionFormat
      • setSmartTagClean

        public final void setSmartTagClean(boolean value)

        Determines whether the smart tag should be cleaned. No inheritance applied. Read/write boolean.

        Specified by:
        setSmartTagClean in interface IPortionFormat
      • getEffective

        public final IPortionFormatEffectiveData getEffective()

        Gets effective portion formatting data with the inheritance applied.


         This example demonstrates getting some effective portion format properties.
         
         Presentation pres = new Presentation("MyPresentation.pptx");
         try
         {
                IAutoShape shape = (IAutoShape)pres.getSlides().get_Item(0).getShapes().get_Item(0);
                IPortionFormatEffectiveData effectivePortionFormat = shape.getTextFrame().getParagraphs().get_Item(0).getPortions().get_Item(0).getPortionFormat().getEffective();
                System.out.println("Latin font: " + effectivePortionFormat.getLatinFont().getFontName());
                System.out.println("Font height: " + effectivePortionFormat.getFontHeight());
                System.out.println("Fill type: " + effectivePortionFormat.getFillFormat().getFillType());
         } finally {
          if (pres != null) pres.dispose();
         }
         
        Specified by:
        getEffective in interface IPortionFormat
        Returns:
        A IPortionFormatEffectiveData.