【问题标题】:Padding left for a text in Prawn对虾中的文本左填充
【发布时间】:2013-09-29 03:25:15
【问题描述】:

我想让某个文本块(不是整个文档)“有左填充”。我可以说:

text_box "some text", :at => [200, 100]

但这不是我要寻找的,因为它指定 x 和 y 作为填充,而我只想指定 x。

我该怎么做?

【问题讨论】:

    标签: ruby-on-rails ruby prawn


    【解决方案1】:

    你可以这样做:

    indent(10, 15) do # left and right padding
      text "Some text"
    end
    

    【讨论】:

      【解决方案2】:

      我现在无法测试,但你可以试试这样:

      text_box "some text", :at => [200, cursor]
      

      其中 cursor 是一个返回 cursor y 位置的方法。

      希望对你有帮助。

      【讨论】:

        猜你喜欢
        • 2017-06-17
        • 1970-01-01
        • 1970-01-01
        • 2010-09-12
        • 2014-10-12
        • 1970-01-01
        • 1970-01-01
        • 2021-11-24
        • 2015-09-28
        相关资源
        最近更新 更多