sách gpt4 ăn đã đi

ruby - Prawn :有没有办法让一个盒子里的所有内容垂直对齐?

In lại 作者:数据小太阳 更新时间:2023-10-29 06:54:31 30 4
mua khóa gpt4 giày nike

我正在尝试将一些内容垂直居中放置在 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
kết thúc

但是如果我的边界框中有多个元素,我该怎么办:

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
kết thúc

那行不通,当您尝试此操作时,文本会被覆盖...

我正在寻找一种方法来对 bounding_box 的全部内容进行分组,然后将整个组垂直对齐。有什么办法可以用 Prawn 做到这一点吗??

非常感谢您的帮助!克里斯

câu trả lời hay nhất

如果您只有文本行,您仍然可以在文本中使用 formatted_text\N :

formatted_text [
{ text: "#{line1}\n" },
{ text: "#{line2}" }
],
valign: :center,
leading: 6

我仍在尝试弄清楚如何处理图片/图例组,因为即使是表格似乎也无法解决问题。

关于ruby - Prawn :有没有办法让一个盒子里的所有内容垂直对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7827916/

30 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress