AlivePDF icon indicating copy to clipboard operation
AlivePDF copied to clipboard

Repeating grid overlaps the header

Open GoogleCodeExporter opened this issue 10 years ago • 2 comments

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 [email protected] on 9 Sep 2011 at 10:03

Attachments:

GoogleCodeExporter avatar Oct 22 '15 18:10 GoogleCodeExporter

Here is the source code.

Thanks,
Ravichandran J

Original comment by [email protected] on 9 Sep 2011 at 3:16

Attachments:

GoogleCodeExporter avatar Oct 22 '15 18:10 GoogleCodeExporter

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 [email protected] on 12 Sep 2011 at 9:43

GoogleCodeExporter avatar Oct 22 '15 18:10 GoogleCodeExporter