部分

部分の位置座標を取得する

getCoordinates() メソッドが IPortion および Portion クラスに追加され、部分の始まりの座標を取得できるようになりました。

  # PPTXを表すPresentationクラスをインスタンス化する
  $pres = new Presentation();
  try {
    # プレゼンテーションのコンテキストを再構築する
    $shape = $pres->getSlides()->get_Item(0)->getShapes()->get_Item(0);
    $textFrame = $shape->getTextFrame();
    foreach($textFrame->getParagraphs() as $paragraph) {
      foreach($paragraph->getPortions() as $portion) {
        $point = $portion->getCoordinates();
        echo("X: " . $point->$x . " Y: " . $point->$y);
      }
    }
  } finally {
    if (!java_is_null($pres)) {
      $pres->dispose();
    }
  }