Project

General

Profile

Actions

Defect #18632

closed

PDF Export has no left padding for tables

Added by @ go2null almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
PDF export
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

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
    

Files

html.png (9.08 KB) html.png @ go2null, 2014-12-12 21:13
rbpdf.png (11.8 KB) rbpdf.png @ go2null, 2014-12-12 21:13
rbpdf-with-left-padding.png (13.2 KB) rbpdf-with-left-padding.png @ go2null, 2014-12-12 21:48
rbpdf-1.18.5.png (16.1 KB) rbpdf-1.18.5.png Jun NAITOH, 2015-01-24 16:13
Actions #1

Updated by Krishna Gollamudi almost 10 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?

Actions #2

Updated by Toshi MARUYAMA almost 10 years ago

Actions #3

Updated by Jun NAITOH almost 10 years ago

This problem fixed by rbpdf 1.18.5.

please bundle update

bundle update rbpdf

Actions #4

Updated by Toshi MARUYAMA almost 10 years ago

  • Target version set to 2.6.2
Actions #5

Updated by Toshi MARUYAMA almost 10 years ago

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

Required rbpdf 1.18.5 in 2.6-stable r13987, thanks.

Actions

Also available in: Atom PDF