NishilSB / alivepdf

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

Repeating grid overlaps the header #332

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Creating PDF

var myPDF:PDF = new PDF(Orientation.LANDSCAPE, Unit.MM, true, Size.LETTER);             
                myPDF.addPage();                

                var grid:Grid = new Grid(this.dp.source, 200, 300, new RGBColor(0xDEDEDE), new RGBColor(0xF7F7F7));
                myPDF.addGrid(grid, 15, 15, true);

                var f:FileStream = new FileStream();
                var file:File = File.desktopDirectory.resolvePath("exported.pdf");
                f.open( file, FileMode.WRITE);
                var bytes:ByteArray = myPDF.save( Method.LOCAL );
                f.writeBytes(bytes);
                f.close();

2. Added a dataProvider that has more data, that will fit it more than one page.

3. Add header in PDF.as

var realWidth:Number = currentPage.width-(leftMargin+rightMargin)*k;    
            var newFont:CoreFont = new CoreFont ( FontFamily.HELVETICA );
            this.setFont(newFont, 12);
            this.textStyle( new RGBColor (0x00) );          
            this.addCell(realWidth,20,headerText,1,0,'C', 1);
            this.newLine(20);

What is the expected output? What do you see instead?
The repeating grid should appear after the header, but is is overlapping the 
header.

What version of the product are you using? On what operating system?
version 0.1.5 RC

Please provide any additional information below.
Source and pdf file is attached. Please uncomment the header function in PDF.as

Original issue reported on code.google.com by ravichandran96@gmail.com on 9 Sep 2011 at 10:03

Attachments:

GoogleCodeExporter commented 8 years ago
Here is the source code.

Thanks,
Ravichandran J

Original comment by ravichandran96@gmail.com on 9 Sep 2011 at 3:16

Attachments:

GoogleCodeExporter commented 8 years ago
The issue is resolved when i replaced the setXY() under addGrid() menthod.

//setXY ( x+getX(),nextPageY );
setXY ( x+getX(),y+getY() ); //hacked to allow user to set the next Page Y of 
Grid

Original comment by ravichandran96@gmail.com on 12 Sep 2011 at 9:43