Word MailMerged document converted to PDF all tables do not have borders.

1 Answer 174 Views
PdfProcessing WordsProcessing
Willem
Top achievements
Rank 1
Willem asked on 20 Jan 2023, 07:54 AM | edited on 20 Jan 2023, 12:32 PM

Hi there,

I am using the trial version at the moment to see if Telerik's document processing can replace another library we are currently using.

Here is our scenario,

We have a Word template document that has merge fields already setup and tables with borders already setup. This word template is read from a database table column into a memory stream and then we use the DocxFormatProvider to import the document to the RadFlowDocument. Below you can see a piece of the template document already setup.

When using EnumerateChildrenOfType<Table>().ElementAt(1) for example I can see that the table is selected and I can see that the border values have been picked up from the word template document. Below inspecting object for the table selected from the template document.

We then perform our mail merge and then use PdfFormatProvider to convert the merge result into a PDF document. The result is that the mail merge fields are merged correctly but all the tables have lost there borders that the original word template document had.

I have tried to after using EnumerateChildrenOfType<Table>().ElementAt(1)  to set the border again manually with new TableBorders(new Border(2, Telerik.Windows.Documents.Flow.Model.Styles.BorderStyle.Dotted, new ThemableColor(Colors.Black))); This also does not work.

Here is the PDF result produced, any suggestions would be appreciated. (Also a note, even if I take out mail merge in the process, the document converting straight from Word Template to PDF still produces the tables with no borders...)

Another note when I use your demo link and load my template and export to PDF the borders are also missing. (Telerik Export to PDF)

1 Answer, 1 is accepted

Sort by
0
Vladislav
Telerik team
answered on 23 Jan 2023, 01:28 PM

Hi Willem,

When exporting a RadFlowDocument to PDF only the Single and None borders are respected correctly. All others are treated as None and stripped from the output file. You can find the feature request on our feedback portal - WordsProcessing: PdfFormatProvider: Support all types of border styles. You can vote and subscribe to the item to receive status updates.

If the dotted border style is not a requirement for you, you can update the borders to Single for the whole template document.

I am really sorry for the inconvenience this missing functionality might be causing you.

Regards,
Vladislav
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Willem
Top achievements
Rank 1
commented on 23 Jan 2023, 04:13 PM

Thanks , making the template document table borders single worked.
Tags
PdfProcessing WordsProcessing
Asked by
Willem
Top achievements
Rank 1
Answers by
Vladislav
Telerik team
Share this question
or