How to adjust pdfgrid top and bottom with thousands of row

Help, I created a pdfgrid with lots of rows but it did only adjust at the top of the first page and the bottom of the last page. Then the second page until second to the last of page has no adjustments its like the height are fitted on pages. 


2 Replies

SV Surya Venkatesan Syncfusion Team February 11, 2022 02:03 PM UTC

Hi Gell,


We recommend you use the PdfLayoutFormat of pagination bounds when draw the grid in PDF document by using following code snippet,

//Create a PdfLayoutFormat for pagination

    PdfLayoutFormat format = PdfLayoutFormat(

        breakType: PdfLayoutBreakType.fitColumnsToPage,

        layoutType: PdfLayoutType.paginate);

    format.paginateBounds =

        Rect.fromLTWH(0, 30, page.getClientSize().width, 500);

 

    //Draw the grid in PDF document page

    grid.draw(

        page: page,

        bounds: Rect.fromLTWH(0, 30, page.getClientSize().width, 500),

        format: format);

Note: Rect.fromLTWH(left, top, width, height) using these values, you can achieve your requirement.


Kindly refer to the following link to get more details,

https://help.syncfusion.com/flutter/pdf/working-with-tables#pagination-in-pdfgrid


Regards,

Surya V



GE Gell February 14, 2022 12:43 AM UTC

it works! thank you so much


Loader.
Up arrow icon