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.