Hello!
We are using Aspose to convert DOCX to PDF and we have found the issue with pdf tag stracture for table style options. It seams that all DOCX table cells are converted to < TD > tag, hovewer some of them should be converted to < TH > tag.
Steps to reproduce
- Run code below. Code converts DOCX file with tables to PDF/A-1b
- Open result PDF with Adobe
- Review tag structure of the tables (you can convert DOCX file with Adobe and compare files tags)
Actual result
All cells are converted as < TD > tag
Expected result:
1st table
Cells of first row and first column are converted as < TH > (because source DOCX table style is “Header Row” and “First Column”)
2nd table
Cells of first row are converted as < TH > (because source DOCX table style is “Header Row” )
3d table (589 Bytes)
Cells of first column are converted as < TH > (because source DOCX table style is “First Column” )
TableIssue.zip (16.5 KB)
Code:
using System;
using Aspose.Words;
using Aspose.Words.Saving;
using Aspose.Words.Tables;
namespace TableIssue
{
class Program
{
static void Main()
{
new License()
.SetLicense("****.lic");
var input = "Tables.docx";
var output = "Table.pdf";
var inputDocument = new Document(input);
var pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.OutlineOptions.HeadingsOutlineLevels = 9;
pdfSaveOptions.DisplayDocTitle = true;
pdfSaveOptions.DmlRenderingMode = DmlRenderingMode.DrawingML;
pdfSaveOptions.ExportDocumentStructure = true;
pdfSaveOptions.Compliance = PdfCompliance.PdfA1b;
pdfSaveOptions.ExportDocumentStructure = true;
foreach (var node in inputDocument.GetChildNodes(NodeType.Table, true))
{
var table = (Table) node;
Console.WriteLine($"Table style: {table.StyleOptions}");
}
inputDocument.Save(output, pdfSaveOptions);
}
}
}