We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem converting DOCX document containing Html Table to PDF

Hello,



I am having trouble when I try to convert a DOCX file to PDF when it contains a Html Table in an inline text container.



In the output PDF-document the Html Table is displayed with the Html code instead of the table rendered as Html as it is in the origin DOCX file.



When making a small modification in the original DOCX file (by adding an x-character in the file) the output PDF is rendered as expected.



See the program code following the post for a way to reproduce the issue. See the attached files for output results from the program.

I am using Aspose.Words v15.1.0.0.



thanks, Henrik







namespace AsposeWordsConverter

{

using System.Diagnostics;

using System.IO;



using Aspose.Words;

using Aspose.Words.Saving;



class Program

{

static void Main(string[] args)

{

if (args.Length
{

Trace.WriteLine("Invalid number of arguments: Expecting AsposeWordsConverter.exe ");

return;

}



string l_sourceFile = args[0];



if (!File.Exists(l_sourceFile))

{

Trace.WriteLine("Specified source file does not exist: " + l_sourceFile);

return;

}



string l_targetFile = l_sourceFile + “.pdf”;



Aspose.Words.Document l_document = new Document(l_sourceFile);

l_document.UpdateFields();



using (var l_resultStream = new FileStream(l_targetFile, FileMode.CreateNew))

{

l_document.Save(l_resultStream, new PdfSaveOptions { Compliance = PdfCompliance.PdfA1b });

}

}

}

}

Hi Johnny,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 15.2.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-11571. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Hi Johnny,


Thanks for being patient. It is to update you that our product team has completed the analysis of this issue (WORDSNET-11571) and the root cause has been identified. Please use the following code to fix this issue:

Document doc = new Document(MyDir + @“HtmlTableDocError.docx”);

PdfSaveOptions saveOptions = new PdfSaveOptions();

saveOptions.DmlRenderingMode = DmlRenderingMode.DrawingML;

doc.Save(MyDir + @“15.6.0.pdf”, saveOptions);


However, please note that Aspose.Words currently doesn’t support DmlRenderingMode.DrawingML option completely.

Best regards,
Hi Johnny,

Regarding WORDSNET-11571, our product team has completed the work on your issue and has come to a conclusion that they won't be able to implement the fix to your issue. Your issue (WORDSNET-11571) is now closed with 'Won't Fix' resolution. Please use the workaround from my previous post.

Best regards,