Gem Prawn 设置下划线属性无效,利用 canvas 进行划线也失效

winse · January 06, 2017 · Last by winse replied at January 06, 2017 · 1456 hits

写导出 pdf 的时候发现设置下划线失效,于是想用画线来代替下划线,发现也没起作用,明明上次用画线都没问题 gem prawn 2.1.0

pdf = Prawn::Document.new(
  page_size: 'A4', 
  page_layout: :portrait,
  left_margin: 50, 
  right_margin: 50, 
  top_margin: 60, 
  bottom_margin: 30, 
  background: 'public/xxxx.jpg', 
  background_scale: 0.239
)
pdf.canvas do
    pdf.line_width = 0.2
    pdf.line([0, 0], [400, 400])
end
pdf.text(
  '下划线测试', 
  align: :center, 
  size: 20, 
  leading: 20,
  styles: [:underline]
)

= =我用 prawn table 的 border:bottom 当下划线用,勉强解决了

winse closed this topic. 06 Jan 15:50
You need to Sign in before reply, if you don't have an account, please Sign up first.