Defect #18632

PDF Export has no left padding for tables

Added by @ go2null almost 4 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:PDF export
Target version:2.6.2
Resolution:Fixed Affected version:2.6.0

Description

  1. rbpdf.png: This is the default export. There is no visible left padding in the generated PDF. This leads to pretty ugly PDF tables.
    # /usr/lib/ruby/gems/1.9.1/gems/rbpdf-1.18.2/lib/rbpdf.rb
    
    3814 starty = @y
    3815 if autopadding
    3816   # Adjust internal padding
    3817   if @c_margin < (@line_width / 2)
    3818     @c_margin = @line_width / 2
    3819   end
    3820   # Add top space if needed
    3821   if (@lasth - @font_size) < @line_width
    3822     @y += @line_width / 2
    3823   end
    3824   # add top padding
    3825   @y += @c_margin
    3826 end
    
  2. rbpdf-with-left-padding.png: Adding the following leads to a better left-padding default.
    # /usr/lib/ruby/gems/1.9.1/gems/rbpdf-1.18.2/lib/rbpdf.rb
    
    3814 starty = @y
    3815 if autopadding
    3816   # Adjust internal padding
    3817   if @c_margin < (@line_width / 2)
    3818     @c_margin = @line_width / 2
    3819   end
    3820   # Add top space if needed
    3821   if (@lasth - @font_size) < @line_width
    3822     @y += @line_width / 2
    3823   end
    +3824   # add left padding
    +3825   @x += @line_width * 2
    3826   # add top padding
    3827   @y += @c_margin
    3828 end
    

html.png (9.08 KB) @ go2null, 2014-12-12 21:13

rbpdf.png (11.8 KB) @ go2null, 2014-12-12 21:13

rbpdf-with-left-padding.png (13.2 KB) @ go2null, 2014-12-12 21:48

rbpdf-1.18.5.png (16.1 KB) Jun NAITOH, 2015-01-24 16:13

Associated revisions

Revision 13987
Added by Toshi MARUYAMA over 3 years ago

Merged r13943 from trunk to 2.6-stable (#18632)

require rbpdf 1.18.5.

History

#1 Updated by Krishna Gollamudi over 3 years ago

I am trying to add export PDF option on one of the plugin screens. Can you help me where all i need to change to make it work?

#3 Updated by Jun NAITOH over 3 years ago

This problem fixed by rbpdf 1.18.5.

please bundle update

bundle update rbpdf

#4 Updated by Toshi MARUYAMA over 3 years ago

  • Target version set to 2.6.2

#5 Updated by Toshi MARUYAMA over 3 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Required rbpdf 1.18.5 in 2.6-stable r13987, thanks.

Also available in: Atom PDF