sivarajankumar / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

Grid incorrectly calculates row height when using Unit.INCHES #170

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
<b>What steps will reproduce the problem?</b>

1. Create a PDF using Inches as units:
<pre>myPDF = new PDF(Orientation.PORTRAIT, Unit.INCHES, Size.LETTER);</pre>

2. Add a grid:
<pre>
var dp:ArrayCollection = new ArrayCollection ();
dp.addItem({firstName : "Bob", lastName : "Groove", city : "Paris"});
dp.addItem({firstName : "Bob", lastName : "Wise", city : "Paris"});
dp.addItem({firstName : "Bob", lastName : "Wise", city : "Paris"});
dp.addItem({firstName : "Bob", lastName : "Wise", city : "Paris"});

var grid:Grid = new Grid(dp.toArray(), 7.5, 3, new RGBColor(0x0066C), new
RGBColor(0xFFFFFF), new RGBColor (0x000000), true, new RGBColor (0x000000),
1, Joint.ROUND);

grid.columns = new Array(
  new GridColumn("First Name", "firstName", 1, Align.LEFT, Align.LEFT),
  new GridColumn("Last Name", "lastName", 1, Align.LEFT, Align.LEFT),
  new GridColumn("City", "city", 1, Align.LEFT, Align.LEFT),
);
myPDF.addGrid(grid, 0.5, 0.5, true);</pre>

<b>What is the expected output? What do you see instead?</b>

Expect to see a grid with 1" columns.  Instead each column appears to take
up the entire page.

<b>What version of the product are you using? On what operating system?</b>

0.1.4.9, WinXP x64
Please provide any additional information below.

Original issue reported on code.google.com by brockm...@gmail.com on 12 Nov 2009 at 3:31

GoogleCodeExporter commented 8 years ago
Google Code comment mangler apparently doesn't accept HTML.

Original comment by brockm...@gmail.com on 12 Nov 2009 at 3:33

GoogleCodeExporter commented 8 years ago
GridColumn works correctly when passed a width that is in units of MM, but not 
inches.  Please see the attached two PDF files (mm.pdf and 
inches.pdf)

Code using MM:
------------------

pdf = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.LETTER);
pdf.setDisplayMode(Display.FULL_PAGE, Layout.SINGLE_PAGE);
pdf.addPage();
pdf.setFont(FontFamily.ARIAL);
pdf.textStyle(new RGBColor(0x000000));
var dp:ArrayCollection = new ArrayCollection();
dp.addItem({ firstName: 'Jamie', lastName: 'McDaniel' });
dp.addItem({ firstName: 'Chad', lastName: 'Tate' });
dp.addItem({ firstName: 'Josh', lastName: 'Sanders' });
var gridColumnFirstName:GridColumn = new GridColumn('First Name', 'firstName', 
40, Align.LEFT, Align.LEFT);
var gridColumnLastName:GridColumn = new GridColumn('Last Name', 'lastName', 80, 
Align.LEFT, Align.LEFT);
var columns:Array = [gridColumnFirstName, gridColumnLastName];
var grid:Grid = new Grid(dp.toArray(), 200, 120, new RGBColor(0xEEEEEE), new 
RGBColor(0xCCCCCC), new RGBColor(0x000000), true, new 
RGBColor(0x000000), 1, Joint.MITER); 
grid.columns = columns;
pdf.addGrid(grid);

Code using INCHES:
------------------

pdf = new PDF(Orientation.LANDSCAPE, Unit.INCHES, Size.LETTER);
pdf.setDisplayMode(Display.FULL_PAGE, Layout.SINGLE_PAGE);
pdf.addPage();
pdf.setFont(FontFamily.ARIAL);
pdf.textStyle(new RGBColor(0x000000));
var dp:ArrayCollection = new ArrayCollection();
dp.addItem({ firstName: 'Jamie', lastName: 'McDaniel' });
dp.addItem({ firstName: 'Chad', lastName: 'Tate' });
dp.addItem({ firstName: 'Josh', lastName: 'Sanders' });
var gridColumnFirstName:GridColumn = new GridColumn('First Name', 'firstName', 
1.57480315, Align.LEFT, Align.LEFT);
var gridColumnLastName:GridColumn = new GridColumn('Last Name', 'lastName', 
3.1496063, Align.LEFT, Align.LEFT);
var columns:Array = [gridColumnFirstName, gridColumnLastName];
var grid:Grid = new Grid(dp.toArray(), 7.87401575, 4.72440945, new 
RGBColor(0xEEEEEE), new RGBColor(0xCCCCCC), new 
RGBColor(0x000000), true, new RGBColor(0x000000), 1, Joint.MITER); 
grid.columns = columns;
pdf.addGrid(grid);

See attached 2 PDFs

Original comment by jamie...@insightbb.com on 26 Jan 2010 at 5:29

Attachments:

GoogleCodeExporter commented 8 years ago
Similar problems for Unit.UNIT except that the height of the rows are very very 
small.

Original comment by darius.z...@gmail.com on 7 Apr 2010 at 7:49

GoogleCodeExporter commented 8 years ago
Similar issues here. In POINTS, grid row heights are tiny with letters sticking 
out, in MM it's better. Happy I found this report though, now at least I can 
try to work around the issue.

Original comment by micros...@gmail.com on 26 May 2011 at 12:44