This is a migrated thread and some comments may be shown as answers.

pdf export table borders

5 Answers 794 Views
WordsProcessing
This is a migrated thread and some comments may be shown as answers.
valentino
Top achievements
Rank 1
valentino asked on 14 Jul 2020, 12:34 PM

Hello,

table cell borders set using

table.Borders = new TableBorders(new Border(BorderStyle.Single));

are missing when using PdfFormatProvider to export a PDF. However, they are present when exporting to DOCX. Please advise. Thanks.

5 Answers, 1 is accepted

Sort by
0
valentino
Top achievements
Rank 1
answered on 14 Jul 2020, 02:43 PM

Not even setting a thickness and color using

table.Borders = new TableBorders(new Border(1, BorderStyle.Single, ThemableColor.FromArgb(1, 0, 0, 0)));

works. This goes for both table and cell borders. Is this a limitation of the PDF processing engine?

0
Accepted
Martin
Telerik team
answered on 16 Jul 2020, 12:15 PM

Hello Valentino,

In the first case when the constructor with only the BorderStyle parameter is used, the default color of the table borders is set to transparent and this is the reason the borders are not visible in the PDF file.

In the second case when the table borders color is set, the Alpha (transparency) of the color is set to 1/255 which is almost transparent as well. You can try to set the Alpha to a higher value (e.g. 255) and the borders should become visible. Check the following code snippet:

table.Borders = new TableBorders(new Border(1, BorderStyle.Single, ThemableColor.FromArgb(255, 0, 0, 0)));
// OR
table.Borders = new TableBorders(new Border(1, BorderStyle.Single, new ThemableColor(Colors.Black)));

Regards,
Martin
Progress Telerik

0
valentino
Top achievements
Rank 1
answered on 23 Jul 2020, 03:20 PM
That did the trick, thanks.
0
Martin
Telerik team
answered on 24 Jul 2020, 06:45 AM

Hi Valentino,

I am happy to hear this solves your case.

In addition, I would like to mention we have a bug report logged in our backlog to change this default behavior: WordsProcessing: Table and TableCell borders width is exported with a default value of zero when not specified. Please, make sure you are following the item so you can receive updates when its status changes.

Regards,
Martin
Progress Telerik

0
valentino
Top achievements
Rank 1
answered on 19 Aug 2020, 10:12 AM
Great to hear, thanks.
Tags
WordsProcessing
Asked by
valentino
Top achievements
Rank 1
Answers by
valentino
Top achievements
Rank 1
Martin
Telerik team
Share this question
or