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.

Sat Jun 24, 2023 12:52 am

2) Code
Code: Select all
            Color borderColor = Color.FromArgb(75, 172, 198);
            String outputFile = "output.pdf";
            PdfDocument pdf = new PdfDocument();
            PdfPageBase page = pdf.Pages.Add(PdfPageSize.A4, new PdfMargins(10, 10, 10, 10));

            PdfTrueTypeFont font3 = new PdfTrueTypeFont(new Font("Arial", 8f, FontStyle.Bold), true);
            PdfStringFormat format3 = new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Middle);
            PdfGrid grid8 = null;
            PdfGrid grid9 = null;
            PdfGridRow pdfGridRow8;
            PdfGridRow pdfGridRow9;
            grid8 = new PdfGrid();
            grid8.AllowCrossPages = true;
            grid8.Style.CellSpacing = 3f;
            grid8.Columns.Add(6);

            grid8.Columns[0].Width = 40;
            grid8.Columns[1].Width = 40;
            grid8.Columns[2].Width = 180;
            grid8.Columns[3].Width = 60;
            grid8.Columns[4].Width = 60;
            grid8.Columns[5].Width = 190;
            pdfGridRow8 = grid8.Headers.Add(2)[0];
            pdfGridRow9 = grid8.Headers[1];

            pdfGridRow8.Height = 20;

            String[] header8 = { "Item #", "Qty", "Disposition", "Responsibility/Expense", "", "Comments/Instructions" };
            String[] header9 = { "", "", "", "Kavlico", "Supplier", "" };
            for (i = 0; i < header8.Length; i++)
            {
                PdfGridCell cell = pdfGridRow8.Cells[i];
                if (i != 4)
                {
                    if ((i == 0) || (i == 1))
                        cell.RowSpan = 2;
                    else
                        cell.RowSpan = 1;
                    if (i == 3)
                        cell.ColumnSpan = 2;
                    else
                        cell.ColumnSpan = 1;
                    cell.Value = header8[i];
                    cell.Style.Font = font3;
                    cell.Style.Borders = borders;
                    cell.StringFormat = format3;
                }
            }
            for (i = 0; i < header9.Length; i++)
            {
                PdfGridCell cell = pdfGridRow9.Cells[i];

                if ((i == 3) || (i == 4))
                {
                    cell.Value = header9[i];
                    cell.Style.Font = font3;
                    cell.Style.Borders = borders;
                    cell.StringFormat = format3;
                }
            }
            grid8.Draw(page, new Point(0, 435));

            pdf.SaveToFile(outputFile, FileFormat.PDF);
            pdf.Close();


3) Version - Spire.Pdf for .NET v4.0.30319
4) OS - Windows 11 64-bit
5) App Type - WinForm 4.7.2


First two columns (0,1) have rowspan=2, colspan=1
Column 2 has rowspan=1, colspan=1
Column 3 has rowspan=1, colspan=2
Column 4 was rowspanned so it should not show up on column4
Column 5 has rowspan=1, colspan=1

I get the output in the attachment, instead of what I thought I asked for above.
PDfGrid.png

tim8w123
 
Posts: 18
Joined: Wed Feb 22, 2023 3:55 pm

Sun Jun 25, 2023 6:43 am

Hello,

Thanks for your inquiry.
I tested your code and did reproduce the issue you mentioned. I have logged the issue into our bug tracking system with the ticket number SPIREPDF-6089. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Fri Oct 13, 2023 8:31 am

Hello,

Thanks for your patient waiting.
I’m writing to inform you that the SPIREPDF-6089 has been resolved. Please download the Spire.PDF Pack(Hot Fix) Version:9.10.2 from the following link.

Website download link: https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
Nuget download link: https://www.nuget.org/packages/Spire.PDF/9.10.2

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF

cron