Free Support Forum - aspose.com

Html Tables does not match between Word and PDF when using Chinese

Hi,

I created the whole word document with html text:

private void writeHtml(DocumentBuilder builder, string html)

{

Inline startOfHtml = (Inline)builder.CurrentNode;

builder.InsertHtml(html);

// Tidy up formatting of paragraphs added by InsertHtml

List<Paragraph> htmlParagraphs = new List<Paragraph>();

htmlParagraphs.Add(builder.CurrentParagraph);

htmlParagraphs.AddRange(builder.CurrentParagraph.GetPrecedingSiblings<Paragraph>(startOfHtml.ParentParagraph));

foreach (Paragraph para in htmlParagraphs)

if (para.ParagraphFormat.SpaceAfter == 14)

para.ParagraphFormat.SpaceAfter = 6;

// Remove trailing cell paragraph left by InsertHtml

if (builder.CurrentParagraph.IsEndOfCell

&& isEffectivelyEmpty(builder.CurrentParagraph))

{

builder.CurrentParagraph.Remove();

}

}

Then I save the doc as PDF.

public void Save(Stream stream, string fileExtension)

{

SaveFormat format = FileFormatUtil.ExtensionToSaveFormat(fileExtension);

if (format == SaveFormat.Unknown)

throw new ArgumentException("File type '" + fileExtension + "' not supported.");

SaveOptions saveOption = SaveOptions.CreateSaveOptions(format);

saveOption.PrettyFormat = true;

_doc.Save(stream, saveOption);

}

If I contain chinese paragraph which contains many words in table, the PDF version will make some columns narrow and it is hard to read it.

I have attached the exported files

I wonder if there is any way to solve the problem.

Thanks a lot.

Hi Zou,

Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-8144 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thanks for your quick update Tahir, I appreciate your help. :slight_smile:

Hi Zou,


Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.