Project

General

Profile

Actions

Defect #18630

open

PDF Export sets table width as 100% by default

Added by @ go2null about 9 years ago. Updated about 9 years ago.

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

0%

Estimated time:
Resolution:
Affected version:

Description

The new PDF gem sets unspecified table widths to 100%.

Please see attached screenshots.

This seems to be the relevant code.

# /usr/lib/ruby/gems/1.9.1/gems/rbpdf-1.18.2/lib/rbpdf.rb

3721 # [@param float :w] Width of cells. If 0, they extend up to the right margin of the page.
3764 def MultiCell(w, h, txt, border=0, align='J', fill=0, ln=1, x='', y='', reseth=true, stretch=0, ishtml=false, autopadding=true, maxh=0)

11964 # table width
11965 if !dom[key]['width'].nil?
11966  table_width = getHTMLUnitToUnits(dom[key]['width'], wtmp, 'px')
11967 else
11968  table_width = wtmp
11969 end

11995 table_columns_width = table_width - (cellspacing * (dom[table_el]['cols'] - 1))
11996 wtmp = colspan * (table_columns_width / dom[table_el]['cols']) + (colspan - 1) * cellspacing
11997 if !dom[key]['width'].nil?
11998   cellw = getHTMLUnitToUnits(dom[key]['width'], table_columns_width, 'px')
11999 else
12000   cellw = wtmp
12001 end

12089 MultiCell(cellw, cellh, cell_content, 0, lalign, 0, 2, '', '', true, 0, true)


Files

html.png (9.08 KB) html.png @ go2null, 2014-12-12 20:05
rbpdf.png (11.8 KB) rbpdf.png @ go2null, 2014-12-12 20:05
Actions #1

Updated by Toshi MARUYAMA about 9 years ago

Actions

Also available in: Atom PDF