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

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?
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

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
