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.

Thu May 04, 2017 10:21 am

Hello!

Code based on the PdfTable:
row = dataTable.NewRow();
row[0] = "test1";
row[1] = "";
dataTable.Rows.Add(row);

row = dataTable.NewRow();
row[0] = "test2";
row[1] = null;
dataTable.Rows.Add(row);


//create PdfTable
table = new PdfTable();

//--------------------------------------------
table.Style.DefaultStyle.Font = new PdfTrueTypeFont(new System.Drawing.Font("Times New Roman", 12f, System.Drawing.FontStyle.Strikeout | System.Drawing.FontStyle.Bold), true);
table.Style.AlternateStyle.Font = new PdfTrueTypeFont(new System.Drawing.Font("Times New Roman", 12f, System.Drawing.FontStyle.Underline | System.Drawing.FontStyle.Regular), true);


//---------------------------------------------

The result in Fig. 1

There is no text in the cell, but underline (strikethrough) appears in the table.
Is it possible to fix it?

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

Fri May 05, 2017 3:29 am

Hi,

Thanks for your inquiry.
I have noticed the issue and posted it to our Dev team. Once there is any progress, we will inform you immediately.
Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu May 25, 2017 9:50 am

Hi,

Thanks for waiting.
Now the issue has been fixed in Spire.PDF Pack(Hot Fix) Version:3.9.124, welcome to have a test.
Looking forward to your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Tue Jun 13, 2017 5:26 am

Spire.PDF Pack(Hot Fix) Version:3.9.124 checked. Unfortunately the error is not fixed.

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

Tue Jun 13, 2017 6:44 am

Hi,

Thanks for your feedback.
I checked the version and confirmed the issue is solved by the version. Please make sure you were using correct version.
Also, I attached my whole code and result PDF for checking.
Code: Select all
            DataTable dataTable = new DataTable();
            dataTable.Columns.Add("columns1", typeof(string));
            dataTable.Columns.Add("columns2", typeof(string));
            DataRow row;
            row = dataTable.NewRow();
            row[0] = "test1";
            row[1] = "";
            dataTable.Rows.Add(row);

            row = dataTable.NewRow();
            row[0] = "test2";
            row[1] = null;
            dataTable.Rows.Add(row);
            PdfDocument doc = new PdfDocument();
            // Create one page
            PdfPageBase page = doc.Pages.Add(PdfPageSize.A4);
            PdfTable table = new PdfTable();
            table.Style.DefaultStyle.Font = new PdfTrueTypeFont(new System.Drawing.Font("Times New Roman", 12f, System.Drawing.FontStyle.Strikeout | System.Drawing.FontStyle.Bold), true);
            table.Style.AlternateStyle.Font = new PdfTrueTypeFont(new System.Drawing.Font("Times New Roman", 12f, System.Drawing.FontStyle.Underline | System.Drawing.FontStyle.Regular), true);
            table.DataSource = dataTable;
            table.Draw(page, new PointF(0, 20));
            doc.SaveToFile("10486.pdf");


Sincerely,
Betsy
E-iceblue support team
User avatar

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

Return to Spire.PDF