8

いくつかのコンテンツを、bounding_box の垂直方向の中央に配置しようとしています。単一のテキストでは、これは問題ありません。

bounding_box([0, bounds.top], :width => pdf.bounds.right, :height => pdf.bounds.top) do
  text "vertically aligned in the surrounding box", :valign => :center
end

しかし、境界ボックスに複数の要素がある場合はどうすればよいですか:

bounding_box([0, bounds.top], :width => pdf.bounds.right, :height => pdf.bounds.top) do
  text "vertically aligned in the surrounding box", :valign => :center
  text "vertically aligned in the surrounding box", :valign => :center
end

これは機能しません。これを試すと、テキストがオーバーレイされます...

bounding_box のコンテンツ全体をグループ化し、そのグループ全体を垂直に揃える方法を探しています。エビでこれを行う方法はありますか??

助けてくれてどうもありがとう!クリス

4

1 に答える 1