Class PPTXFormatter

java.lang.Object
com.nomagic.magicreport.format.DefaultFormatter
com.nomagic.magicreport.format.PPTXFormatter
All Implemented Interfaces:
IFormatter

@OpenApiAll public class PPTXFormatter extends DefaultFormatter
The Velocity engine support for PPTX.
Since:
Dec 29, 2009
  • Constructor Details

    • PPTXFormatter

      public PPTXFormatter(ITemplateEngine templateEngine)
      Create a PPTX formatter with specific properties.
      Parameters:
      templateEngine - template engine
    • PPTXFormatter

      public PPTXFormatter(Properties properties)
      Create a PPTX formatter with specific properties.
      Parameters:
      properties - template properties
  • Method Details

    • format

      public Object format(Object value)
      Convert an Object value into PPTX format.
      Specified by:
      format in interface IFormatter
      Overrides:
      format in class DefaultFormatter
      Parameters:
      value - converting value
      Returns:
      object in default format.
    • createImage

      protected ITool.RetainedString createImage(Image image) throws IOException
      Create a PPTX image string from given Image object.
      Parameters:
      image - an Image object
      Returns:
      The String in PPTX image format.
      Throws:
      IOException - when IO error occurs
    • createImage

      protected ITool.RetainedString createImage(Image image, float width, float height, int flag) throws IOException
      Create a PPTX image string from given Image object. PPTX always ignore flag attribute. The image size always automatically fit to text box. And no rotation supports.
      Parameters:
      image - an Image object
      width - the target image width
      height - the target image height
      flag - scaling image flag
      Returns:
      The String in PPTX image format.
      Throws:
      IOException - when IO error occurs
    • getPageSize

      public float[] getPageSize()
      Calculation for total paper width and total paper height after minus margin of page.
      Returns:
      float[] array of paper width and paper height
    • createBookmark

      protected ITool.RetainedString createBookmark(Bookmark bookmark) throws IOException
      Create a PPTX bookmark string from given Bookmark object.
      Parameters:
      bookmark - an Bookmark object
      Returns:
      The String in PPTX bookmark format.
      Throws:
      IOException - when IO error occurs
    • createLink

      protected ITool.RetainedString createLink(Link link) throws IOException
      Create a PPTX link string from given Link object.
      Parameters:
      link - an Link object
      Returns:
      The String in PPTX link format.
      Throws:
      IOException - when IO error occurs
    • createGridSpan

      protected String createGridSpan(GridSpan span)
      Create a PPTX gridspan (merge columns horizontally) string from given GridSpan object.
      Parameters:
      span - an GridSpan object
      Returns:
      The String in PPT for gridspan format.
    • createColumn

      protected String createColumn(Column column)
      Increase new columns from given Column object.
      Parameters:
      column - an Column object
      Returns:
      The String of new columns
    • createGridRowSpan

      protected ITool.RetainedString createGridRowSpan(GridRowSpan span)
      Create a PPTX gridrowspan (merge columns vertically) string from given GridRowSpan object.
      Parameters:
      span - an GridRowSpan object
      Returns:
      The String in PPTX for gridrowspan format.