Hi Aaron,
Convert table from Word to PDF documentIt is not directly not possible to convert a specific table in a word document as a PDF document. But we can achieve the same feature by following the below mentioned steps,
1. Convert the table from a word document as a DataTable.
2. Set the DataTable to the PdfDocument`s PdfLightTable DataSource object.
3. Draw the PdfLightTable in a PdfDocument.
Kindly look into the below specific code which converts the existing word document`s table as DataTable,
IWTable table = document.Sections[0].Tables[0];
// Convert the existing table as DataTable
DataTable dt = new DataTable("dt");
for (int i = 0; i < table.FirstRow.Cells.Count; i++)
dt.Columns.Add(table.FirstRow.Cells[i].Paragraphs[0].Text);
for (int i = 0; i < table.Rows.Count; i++)
{
string[] s = new string[dt.Columns.Count];
for (int j = 0; j < table.Rows[i].Cells.Count; j++)
{
s[j] = table.Rows[i].Cells[j].Paragraphs[0].Text;
}
dt.Rows.Add(s);
}
Could you please do find the sample which demonstrates the above mentioned feature and let me know if this helps?
http://files.syncfusion.com/samples/PDF.Windows/PDF_Win_F89730_Modified.zipRegards,
Suba