Print
PDF
Feb
25

Great Enhancements on Word Conversion Feature with Spire.Doc 4.6.20

We are really happy to announce that Spire.Doc 4.6.20 has been released. Many important features especially word conversion feature have been greatly improved in this hotfix. Among word conversions, word to PDF is mostly concerned by our customers. So we focus on fixing bugs existing on word to PDF. Now, please allow me to introduce them one by one.

Word to PDF Conversion

Four bugs have been fixed during word to PDF conversion. The first one is that after loading doc/docx file and save the doc file as PDF to stream by the method: SavetoStream(); the program hangs indefinitely. Now it has been fixed. The second problem solved in this version is that some dotted lines become full lines after conversion. The third bug comes to the page number issue in the footer. The page number cannot be correctly shown in PDF file after conversion when use the FieldType property FieldSectionPages. The last bug is that the special string in RTF file cannot be converted to PDF file in correct format, such as string in checkbox or text with alignments.

Word to Html Conversion

The new version makes it possible when convert a word file with footer to html file. When you set the word header and footer to be different with first word page header and footer, the target html file only convert first page header and footer. So if you want to convert header and footer correctly to html, you’d better set every header and footer of each page to be the same.

Word to Text Conversion

For converting complicated doc/docx file to .txt, it throws an exception in old version: “Complex file cannot be supported at Spire.Doc.Document. LoadFromStream(Stream stream, FileFormat fileFormat, String password). Now, it has been fixed.

Doc to Docx Conversion

This new version also fix the bug that Doc file which contains irregular content for example, there are frames and each frame has one or more paragraphs cannot be completely converted to docx. The frames are missing in the target Docx file.

Word Merge

Word merge feature enables you to quickly merge word files into one. But sometimes, you find that the text position of the merged file is a little different with the original file. Also the file format of the first word page influences the second, the third…etc. Here I give you an example, suppose there are two word file, I want to merge them into one. I set the page border of the first file surround the header and footer, but the second not. When I merge them into one, the second word page in the merge word file also has borders surround the header and footer, in such a case,we need to add another two lines after the code:

 
string fileName = @"..\..\File1.doc";
string fileMerge = @"..\..\File2.doc";
if ((!string.IsNullOrEmpty(fileName)) && (!string.IsNullOrEmpty(fileMerge)))
{
Spire.Doc.Document document = new Spire.Doc.Document();
document.LoadFromFile(fileName, FileFormat.Doc);
Spire.Doc.Document documentMerge = new Spire.Doc.Document();
documentMerge.LoadFromFile(fileMerge, FileFormat.Doc);
foreach (Spire.Doc.Section sec in documentMerge.Sections)
{ document.Sections.Add(sec.Clone()); }
//added two lines 
document.Sections[0].PageSetup.PageBorderIncludeFooter = false;
document.Sections[0].PageSetup.PageBorderIncludeHeader = false;
document.SaveToFile("MergedDocument.doc", FileFormat.Doc);
System.Diagnostics.Process.Start("MergedDocument.doc");
}

BorderType Setting

New release enables you to set the word table border type to be single by RowFormat.Borders.Top.BorderType = BorderStyle.Single;

Want to try or test the new features? Please visit the download page:

Written by support iceblue.