Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Jan 17, 2017 8:53 am

Hello!

I have a working code based on the PdfTable:

table.BeginPageLayout += new BeginPageLayoutEventHandler(table_BeginPageLayout);

tableLayout.Break = PdfLayoutBreakType.FitElement;
tableLayout.Layout = PdfLayoutType.Paginate;
tableLayout.PaginateBounds = new System.Drawing.RectangleF(X, Y, W, H);
table.Draw(page, new System.Drawing.PointF(X, Y), tableLayout);


Since it is necessary in the header of the report cell merging, it had to be replaced the PdfTable on the PdfGrid.

grid.BeginPageLayout += new BeginPageLayoutEventHandler(table_BeginPageLayout);

gridLayout.Break = PdfLayoutBreakType.FitElement;
gridLayout.Layout = PdfLayoutType.Paginate;
gridLayout.PaginateBounds = new System.Drawing.RectangleF(X, Y, W, H);
grid.Draw(page, new System.Drawing.PointF(X, Y), tableLayout);

There was a problem on large tables that occupy more than one page.
Grid ignores the specified limits. Do not call handler table_BeginPageLayout.

hanter123@rambler.ru
 
Posts: 10
Joined: Fri Dec 18, 2015 5:12 am

Tue Jan 17, 2017 9:34 am

Hi,

Thanks for your inquiry.
The BeginPageLayout is not same for PdfTable and PdfGrid, it has different properties. How did you set the event handler grid_BeginPageLayout? And what do you want to achieve, could you please describe your issue in detail and provide us all the code related this issue ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Jan 17, 2017 10:15 am

Hi, Betsy1

static void table_BeginPageLayout(object sender, BeginPageLayoutEventArgs args)
{

Spire.Pdf.Graphics.PdfTemplate template = get_template();

args.Page.Canvas.DrawTemplate(template, new System.Drawing.PointF(0, 0));

}

The handler loads a new page template. We need an analogue to the grid.

Thanks, Igor.

hanter123@rambler.ru
 
Posts: 10
Joined: Fri Dec 18, 2015 5:12 am

Wed Jan 18, 2017 3:48 am

Dear Igor,

Thanks for your information.
I have tested that code with the latest Spire.PDF Pack(Hot Fix) Version:3.8.152. I found if the grid is large, more than one page, the template can be drawn on the first few pages of result PDF, but in the last page the template is missing. And I have posted this issue to our Dev team, we will inform you once there is any news.
Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Jan 18, 2017 4:26 am

Thanks!

hanter123@rambler.ru
 
Posts: 10
Joined: Fri Dec 18, 2015 5:12 am

Mon Feb 06, 2017 8:49 am

Dear Igor,

Thanks for waiting.
Now the issue has been fixed in Spire.PDF Pack(Hot Fix) Version:3.8.173, welcome to test it.
Looking forward to your reply.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Feb 13, 2017 6:47 am

Dear Igor,

Did you test the hotfix ? Has the issue been resolved ?
Could you please give us some feedback at your convenience ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Feb 17, 2017 4:55 am

Hi, Betsy!

Thank you for your response. I have decided to task in a different way, without the use of PdfGrid. Spire.PDF Pack (Hot Fix) Version: 3.8.173 will test as soon as possible.

Sincerely, Igor.

hanter123@rambler.ru
 
Posts: 10
Joined: Fri Dec 18, 2015 5:12 am

Return to Spire.PDF